-
Notifications
You must be signed in to change notification settings - Fork 0
/
number.py
32 lines (28 loc) · 862 Bytes
/
number.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from art import logo
import random
print(logo)
computer = random.randint(1, 100)
value = computer
print("Welcome to number guessing game, you'll be asked to choose numbers")
difficulty = input("Please Enter the difficulty h for hard e for easy ")
def result(user, computer):
if int(user) < int(value):
print("Too Low")
elif int(user) > int(value):
print("Too High")
else:
print("You guessed it correct")
if difficulty == "e":
for count in range(9):
user = input("Please enter a number between 1 to 100 ")
#print(value)
value = computer
result(user, value)
value = None
if difficulty == "h":
for count in range(4):
user = input("Please enter a number between 1 to 100 ")
#print(value)
value = computer
result(user, value)
value = None