rychair 发表于 2020-10-20 20:50:18

零基础入门学Python第三课后作业

>>> DaysPerYear = 360
>>> HoursPerDay = 24
>>> MinutesPerHour = 60
>>> SecondsPerMinute = 24
>>> HMS = DaysPerYear * HoursPerDay * MinutesPerHour * SecondsPerMinute
SyntaxError: multiple statements found while compiling a single statement

看不出哪里错啦,请大师指教

>>> DaysPerYear = 365
HoursPerDay = 24
MinutesPerHour = 60
SecondsPerMinute = 60
result = DaysPerYear * HoursPerDay * MinutesPerHour * SecondsPerMinute
print(result)
SyntaxError: multiple statements found while compiling a single statement

这个是复制的答案为啥也错了?
谢谢大师指点一二。

昨非 发表于 2020-10-20 20:52:00

idle单次只支持单行代码运行

昨非 发表于 2020-10-20 20:52:42

这种情况要么一行一行敲,要么新建.py文件然后保存下来一起运行
页: [1]
查看完整版本: 零基础入门学Python第三课后作业