Skip to content

Commit 153830f

Browse files
committed
a small fix
1 parent 0a526f3 commit 153830f

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import random
22

3-
def guess(num):
4-
random_number = random.randint(1, num)
5-
guess = 0
6-
while guess != random_number:
7-
guess = int(input(f"Guess the number between 1 & {num}: "))
8-
if guess < random_number:
9-
print("Wrong! Too low...")
10-
elif guess > random_number:
11-
print("Wrong! Too high...")
12-
print(f"Thats Right! Random number is {random_number}")
3+
max_num = 30
134

14-
guess(10)
5+
random_number = random.randint(1, max_num)
6+
guess = 0
7+
while guess != random_number:
8+
guess = int(input(f"Guess the number between 1 & {max_num}: "))
9+
if guess < random_number:
10+
print("Wrong! Too low...")
11+
elif guess > random_number:
12+
print("Wrong! Too high...")
13+
print(f"Thats Right! Random number is {random_number}")

0 commit comments

Comments
 (0)