我正在编程课程的介绍中,我们正在制作一个计算器,根据某人活着的年数计算人类心脏被击败的次数,并且在最后一次解析时我一直得到意想不到的EOF代码行,有人可以帮我找出原因吗?
input("What is your name? ")
age= float(input("How old are you? "))
print("The average human heart beats 70 times a minute.")
beats_per_hour = 70 * 60
beats_per_day = beats_per_hour * 24
beats_per_year = beats_per_day * 365
beats_age = beats_per_year * age
print(format("Beats per minute: 70"))
print(format("Beats per hour:",beats_per_hour))
print(format("Beats per day:",beats_per_day))
print(format("Beats per year:",beats_per_year))
print(format("Your heart has taken",beats_age,"beats, since you were born.")enter code here
答案 0 :(得分:0)
我相信您的直接问题是您忘记了最后一行的右括号:请注意您在该行的末尾只有一个R_PAREN,而在所有其他行中只有两个。此外,您是否要在第1行中保存用户名?
这里有link来帮助键盘输入。