Files
python-tests/guess_number.py

17 lines
373 B
Python

#!/usr/bin/env python3
import random
if __name__ == "__main__":
num = random.randint(1,100)
while True:
n = int(input('Input a number:'))
if n == num:
print(f'Found it, the number is: {num}')
exit(0)
elif n < num:
print('Too small, guess again')
else:
print('Too big, guess again')