【发布时间】:2019-06-28 19:49:59
【问题描述】:
我总是在线路上收到错误的输入,但我不知道如何解决它。 如果格式不正确,请见谅。
这是在 python 2.6 上
videoGames = ["Fortnite", "Minecraft", "Roblox", "2048", "Mario Cart"]
favGame = raw_input("What is your favorite video game?")
if favGame == videoGames[1]
print("Hi.")
print("Really?! We both enjoy playing") #add the input that matches with the list
如果用户输入匹配列表中的一项,那么它将打印“真的吗?!我们都喜欢玩(游戏)
【问题讨论】:
标签: python list if-statement printing