Files
python-tests/guess_number.py
2025-09-24 22:08:28 +08:00

17 lines
374 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('Less than the number')
else:
print('Greater than the number')