所以我有我的代码在这里为我使用PyDev在Eclipse霓虹灯Python 3.4中创建的骰子滚动模拟器游戏。当你猜一个数字,从1-6的值将随机生成,如果你得到多少吧,你继续前进等Python 3.4骰子滚动模拟器代码错误
guess1 = input("Enter your first guess as to which side the dice will roll on (1-6): ")
import random
dice_side = ['1','2','3','4','5','6']
game = print(random.choice(dice_side))
if guess1 == game:
print("Congrats that's the correct guess!")
else:
print("That's the wrong guess!")
我测试了代码,每次我提出一个数字,控制台始终打印“这是错误的猜测!”。即使我猜的数字与生成的数字相匹配。我无法弄清楚这有什么问题。我在想,也许我应该使用而不是循环。但是,我想知道我是否可以这样做,这个特定的代码有什么问题。我是Python的新手,所以任何帮助表示赞赏。提前致谢!
想想'print'返回什么。 – user2357112