我正在尝试将我的游戏组织成一种玩python的方式。到目前为止,这是我的代码:
Skyrim = "Skyrim"
GTAIV = "GTAIV"
GTASA = "GTASA"
Games = Skyrim + " " + GTAIV + " " + GTASA
这就是现在的字面意思。基本上我要问的是我如何制作一个相当于“If input == this”
的条件答案 0 :(得分:4)
真的非常简单:
Skyrim = "Skyrim"
GTAIV = "Skyrim"
GTASA = "Skyrim"
Games = Skyrim + " " + GTAIV + " " + GTASA
if raw_input("Enter: ") == "Games":
print Games
输出:
Enter: Games
Skyrim Skyrim Skyrim