【发布时间】:2016-09-29 16:14:19
【问题描述】:
我想插入一个数字,如果我输入 4 以外的任何数字,它会告诉我这是错误的,但如果它是错误的,它会告诉我“gg you win, noob.”。但是当我插入 4 时,它告诉我它不正确。
x = input("Insert a numer: ")
while x != 4:
print("incorrect")
x =input("Insert another number: ")
if x == 4:
print("gg you win, noob")
【问题讨论】:
-
Python 2 还是 Python 3 ?
-
公平假设他说的是 3,因为这适用于 2。
-
@brianpck 这是一个合理的假设,但我不会在 2 中准确地说 "works"。无论哪种方式,代码都是错误的,但存在不同的问题。
-
@brianpck 是的。这是python 3
标签: python