解析时出现意外的EOF?

时间:2015-11-04 17:36:23

标签: python python-3.x

import random
import time

print ('WELCOME TO MYSTREY MADNESS warning this is my first game their will be bugs')
time.sleep (2)
print ('you will be asked to pick a route and the game will pick a random outcome')
time.sleep (2)
print ('pick one of the two options that will appear in a moment type 1 or 2 next to the one that you wnat to pick')
time.sleep (2)
guess_1 = int(input('you are at the beach you are bored type 1 to go to the rock pools type 2 to go to the cave')
    if guess_1 == 1
        ("you went to the rock pools what do you do now?")
    else guess_1 == 2,
        print('you go to the cave and look into the darkness what do you do now?'),

我在我唯一的输入上尝试了原始输入,但它仍然给我一个错误信息。

1 个答案:

答案 0 :(得分:1)

正如Morgan所说,代码中存在一些语法错误。您应该关闭一些括号并删除某些行末尾的逗号。 这段代码应该运行良好:

import random
import time

print ('WELCOME TO MYSTREY MADNESS warning this is my first game their will be bugs')
time.sleep (2)
print ('you will be asked to pick a route and the game will pick a random outcome')
time.sleep (2)
print ('pick one of the two options that will appear in a moment type 1 or 2 next to the one that you wnat to pick')
time.sleep (2)
guess_1 = int(input('you are at the beach you are bored type 1 to go to the rock pools type 2 to go to the cave'))
if (guess_1 == 1):
    print("you went to the rock pools what do you do now?")
elif (guess_1 == 2):
    print('you go to the cave and look into the darkness what do you do now?')