EOL扫描字符串文字时,文件将无法运行

时间:2014-08-31 23:01:55

标签: python string

我已经检查了30多次,我不知道字符串是什么问题。它一定是次要的,我无法看到。

#Description

print("Costs of EMS responses")

Print("Choose the costs of providing Emergency Medical Services \
     + \n to your region. Remember, half will be covered by insurance \
     + \n of the patient then the rest will have to be paid out of pocket \
     + \n by the patient himself/herself.
")

#Variables

als = int(input("Advanced Life Support: "))
bls = int(input("Basic Life Support: "))
fireresponse = int(input("Fire Response: "))
aeromedical = int(input("EMS Helicopter: "))
citypolice = int(input("City Police: "))
statepolice = int(input("State Police: "))
countypolice = int(input("County Police: "))
swat = int(input("SWAT Team: "))
total = als + bls + fireresponse + aeromedical + citypolice + statepolice + countypolice + swat

print("\nCombined amount of costs from services in the region: ", total)

input("\n\n\nPress enter to exit menu)

1 个答案:

答案 0 :(得分:1)

这是我看到的第一个:

input("\n\n\nPress enter to exit menu)

第二个是你忘了在这一行末尾的代码中转换换行符:

 + \n by the patient himself/herself.