脑袋想破了 也不知道他俩差在哪 第一个能运行 第二个就不行
print("小游戏")啦啦 = input("猜字游戏")
撸撸 = int(啦啦)
while 撸撸 != 8:
啦啦 = input("猜错了再来")
撸撸 = int(啦啦)
if 撸撸 ==8:
print("haha ")
else:
if 撸撸 > 8:
print("大了")
else:
print("小了")
print("jieshu")
print("小游戏")
lala = input("猜猜数字")
guess = int(lala)
while guess != lala:
lala = input("再来")
guess = int(lala)
if guess == lala:
print("答对了")
else:
if guess > lala:
print("大了")
else:
print("小了")
print("结束") {:5_107:} if guess == lala:
print("答对了")
else:
if guess > lala:
print("大了")
else:
print("小了")
guess是数字,而lala是字符串两个不能比较哦 while guess != lala:
lala = input("再来")
guess = int(lala)
if guess == lala:
print("答对了")
else:
if guess > lala:
print("大了")
else:
print("小了")
错在这路,while 的条件 和 if 的条件都是错误的 qq1151985918 发表于 2021-4-28 08:14
while guess != lala:
lala = input("再来")
guess = int(lala)
谢谢
页:
[1]