Skip to content

Commit ce3ff93

Browse files
committed
2 parents 2129673 + d47480d commit ce3ff93

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

basics/loops.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,13 @@ while True:
377377
option = input("Choose an option: ")
378378

379379
# Things like option == 0 don't work because option is a string
380-
# and it needs to be compared with a string.
380+
# and it needs to be compared with a string:
381+
# >>> 0 == 0
382+
# True
383+
# >>> '0' == '0'
384+
# True
385+
# >>> 0 == '0'
386+
# False
381387
if option == '0':
382388
print("Bye!")
383389
break

0 commit comments

Comments
 (0)