程序运行截图如下:
源码如下:
- import random
-
- print("Let's play a funny game")
- num=random.randint(100,999999)
- temp=input("please input a number while is in my mind:")
- while True:
- if(num==int(temp)):
- print("you're right!")
- print("you're a bug in my stomach!")
- break
- elif(num>int(temp)):
- print("The input number is too smaller than my number!")
- else:
- print("The input number is too bigger than my number!")
- temp=input("please input a number once again:")
- pass
- else:
- print("you are winner!")
- print("Game over!");