Skip to content

Commit 42155c2

Browse files
committed
fix bug in code
1 parent f66b404 commit 42155c2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

week-4/Game/game.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ def main():
1616

1717
while True:
1818
user = valid_input("Guess: ")
19+
if user == 1 and input_user == 1:
20+
print("Just right!")
21+
break
22+
1923
if user < rand_number:
2024
print("Too small!")
25+
2126
elif user > rand_number:
2227
print("Too Large!")
28+
2329
else:
2430
print("Just right!")
2531
break
@@ -29,6 +35,8 @@ def valid_input(message_in):
2935
while True:
3036
try:
3137
temp = int(input(message_in))
38+
if temp <= 0:
39+
continue
3240
except ValueError:
3341
continue
3442
else:

0 commit comments

Comments
 (0)