SyntaxError: invalid syntax 错在哪了啊
cars = 100space_in_a_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_a_car
avergae_passengers_per_car = passengers / cars_driven
print("There are",cars,"cars available.")
print("There are only",drivers,"drivers available.")
print("There will be",cars_not_driven,"empty cars today.")
print("We can transport",carpool_capacity,"people today.")
print("We have",passengers,"to carpool today.")
print("We need to put about",avergae_passengers_per_car,"in each car.") 你的代码中有一个拼写错误。在最后一行代码中,"average_passengers_per_car" 被拼写为 "avergae_passengers_per_car"。将其更正为 "average_passengers_per_car" 后,代码将不再报错。 你的代码没有问题——可以尝试上传一下完整代码或报错提示。
页:
[1]