如何解决我的代码中需要冒号,但我收到了错误
我尝试创建一个子例程并得到一个错误,提示在 if typeOfAircraft = 1: 行中需要冒号。我该如何解决?
def flightPlan():
typeOfAircraft = int(input(' PLease enter the type of aircraft to be used. \n 1.Medium Narrow Body \n 2. Large Narrow Body \n 3. Medium Wide Body \n choice:'))
while typeOfAircraft != 1 or typeOfAircraft != 2 or typeOfAircraft != 3:
print('Error - wrong input')
typeOfAircraft = int(input(' PLease enter the type oaircraft to be used. \n 1.Medium Narrow Body \n 2. Large Narrow Body \n 3. Medium Wide Body \n choice:'))
print('Running cost per seat per 100 km Maximum flight range Capacity if all seats are standard-class Minimum number of first-class seats (if there are any)')
if typeOfAircraft = 1:
print('it worked')
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。