我一直在这几个小时,搜索问题,甚至问我的兄弟,他是 EE 的大四学生,甚至他也被难住了。这是一个今晚午夜前到期的项目,我似乎无法摆脱这个错误。任何人都可以查看我的代码并弄清楚为什么我不断收到此错误吗?谢谢,是的,它们在 while 语句下方正确缩进。
# Initialize Variables
count = 0
#First Customer Input
cus = input("Enter customer's name: ")
custype = input("Enter customer's service type (R for Residential. B for Business): ")
location = input("Enter customer's service location (C for City. P for Parish): ")
kwh = eval(input("Enter customer's number of Kilowatt Hours Used: ")
#Repeat loop based on input items NOT being the sentinel value
while (count < 10):
if custype == 'R' and location1 == 'C':
rate = residentialCity
elif custype == 'R' and location1 == 'P':
rate = residentialParish
elif custype == 'B' and location1 == 'C' or 'P':
rate = business