2025-05-26 06:49:34 +08:00
|
|
|
import numpy as np
|
|
|
|
|
|
|
|
compnum = np.random.randint(1, 100)
|
|
|
|
|
2019-07-17 21:43:09 +08:00
|
|
|
count = 0
|
|
|
|
number = int(input('Enter number to guess : '))
|
|
|
|
while number != compnum:
|
|
|
|
if number > compnum:
|
|
|
|
print('The number is to high')
|
|
|
|
else:
|
|
|
|
print('The number is to low')
|
|
|
|
count = count + 1
|
|
|
|
number = int(input('Enter number to guess : '))
|
|
|
|
print('Well done, you took {0}'.format(count))
|