|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
"Guess Game"作品代码(拷贝即用):
import time
import random
play_the_game = True
score = 0
print("Let's play a game!")
print('I will write some numbers,you must remeber them,and write them out.')
anser = str(input('Would you play with me?Please answer Yes or No.'))
while play_the_game:
if anser == 'Yes':
right_anser = random.randint(10000000,99999999)
print('You have three seconds to remeber the right anser:',right_anser)
print(3)
time.sleep(1)
print(2)
time.sleep(1)
print(1)
time.sleep(1)
print('\n'*44)
anser = int(input('What is the right answer?'))
if anser == right_anser:
print('Yes,you are right!')
score = score + 1
anser = 'Yes'
continue
else:
print('The right number is',right_anser,',you need to remeber it quiekly!')
print('Your score is',score)
break
else:
if anser == 'No':
print('OK...')
play_the_game = False
else:
print('Please say Yes or No.')
continue
可以给些建议,谢谢🙏
(后期会更新) |
|