feat: add guess number

This commit is contained in:
2025-09-24 22:08:28 +08:00
parent f8cd29cfb7
commit bbe41f0cfe

16
guess_number.py Normal file
View File

@@ -0,0 +1,16 @@
#!/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')