You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code ran in 2 different notebooks gives two different results. One of them is duplicating the printing command as you can see (in the screenshots attached)
and the other one is perfectly fine. And yes, I've restarted the kernel and cleaned all outputs before running both. Can you help please? I've spent tons of time around this and cannot figure out what's wrong ...
def user_choice():
choice ='WRONG'
within_range = False
while choice.isdigit() == False or within_range == False:
choice = input("Please enter a number (0-10): ")
if choice.isdigit() == False:
print("Sorry that is not a digit!")
if choice.isdigit() == True:
if int(choice) in range(0,11):
within_range = True
else:
print("Sorry, that number is not between 0-10.")
within_range = False
return int(choice)`
The text was updated successfully, but these errors were encountered:
The following code ran in 2 different notebooks gives two different results. One of them is duplicating the printing command as you can see (in the screenshots attached)
and the other one is perfectly fine. And yes, I've restarted the kernel and cleaned all outputs before running both. Can you help please? I've spent tons of time around this and cannot figure out what's wrong ...
def
user_choice():The text was updated successfully, but these errors were encountered: