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
# Write a guessing game where the user must guess a secret number. After every guess the program tells the user whether their number was too large or too small. At the end the number of tries needed should be printed. It counts only as one try if they input the same number multiple times consecutively.
4
+
5
+
fromrandomimportrandint
6
+
7
+
print("Guess a number between 1 and 50.")
8
+
secretNum=randint(0,50)
9
+
# Generate random int adapted from https://stackoverflow.com/questions/3996904/generate-random-integers-between-0-and-9
0 commit comments