or
關鍵字也是用來把多個條件放在一起。如果使用 or
,只要任意一個條件為真,就會執行代碼塊。
color = raw_input("Enter your favorite color: ")if color == "red" or color == "blue" or color == "green": print "You are allowed to play this game."else: print "Sorry, you can't play the game."