【发布时间】:2015-09-04 00:19:07
【问题描述】:
我正在上编程课的介绍,我们正在制作一个计算器来计算一个人的心脏跳动了多少次,考虑到一个人已经活着的年数,我在解析最后一个时不断收到意外的 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
【问题讨论】:
-
你的脚本真的以不平衡的括号和
enter code here文本结尾吗?
标签: python python-3.x eof