小编use*_*994的帖子

如何在python中正确退出程序

我是一名中学生,我开始学习python中的编码.我一直在看视频教程,但我似乎无法弄清楚如果你键入q如何让游戏退出.在这里我有...

print('How old do you thing Fred the Chicken is?')
number = 17

Quit = q
run = 17
while run:

guess = int(input('Enter What You Think His Age Is....'))

print('How old do you thing Fred the Chicken is?')
number = 17

Quit = 'q'
run = 17
while run:

guess = int(input('Enter What You Think His Age Is....'))

if guess == number:
    print('Yes :D That is his age...')
    run = False
elif guess < number:
    print('No, Guess a little …
Run Code Online (Sandbox Code Playgroud)

python string quit python-3.x

8
推荐指数
1
解决办法
3万
查看次数

标签 统计

python ×1

python-3.x ×1

quit ×1

string ×1