当我编译下面的 Python 代码时,我得到 IndentationError: unindent does not match any external indentation level# main module
def main():
# Local variables
weight = 0.0
shipping = 0.0
# Get package weight
weight = int(input("Enter the weight of the package: "))
# Calculate the shipping charge
if weight < 2:
shipping_charge = '$1.10'
elif weight > 2 and weight < 6:
shipping_charge = '$2.20'
elif weight > 6 and weight < 10:
shipping_charge = '$3.70'
elif weight > 10:
shipping_charge = '$3.80'
# print shipping charge
showShipping(shipping)
print("Shipping charge:", shipping_charge)
为什么?