Discuss / Python / 请教下这个语句怎么才能在输入8后结束循环

请教下这个语句怎么才能在输入8后结束循环

Topic source

qs阿怪

#1 Created at ... [Delete] [Delete and Lock User]

print('猜我想的数字') a=input('请输入') a=True while a!=8: a=input('请输入') else: print('结束') 初学python,请教下这个语句怎么才能在输入8后结束循环。

joker_up

#2 Created at ... [Delete] [Delete and Lock User]

print('猜我想的数字') a = input('请输入:') b = int(a) while b != 8: a = input('请输入:') b = int(a) print("结束")


  • 1

Reply