Python coinflip无效语法打印帮帮我吧

时间:2017-03-11 18:55:44

标签: python printing syntax invalidation

所以我基本上就像一个硬币翻转脚本一样,它在最后一次打印时给了我“无效的语法”。你能帮我吗?

import random
print('Choose a number between 1 and 0')
answer=input()
number=random.choice('10')
random.choice('10')
print(random.choice('10'))
if answer == (number
              print("You won"))

1 个答案:

答案 0 :(得分:1)

if answer == (number
              print("You won"))

应该是

if answer == number:
    print("You won")