EDIT -- I just saw that the solutions are all there when you press submit, oops
Hi!
Can anyone tell me the error in this code? Since this isn't an assignment, I'll post it here. When typing in a weight, I currently get infinite "very heavy"'s printed. Thank you in advance for any help ^^
def analyzeWeight(weight):
while weight != -1:
if weight >= 70:
print("very heavy")
elif weight >= 10 and weight < 70:
print("heavy")
elif weight >= 2 and weight < 10:
print("light")
elif weight < 2 and weight > 0:
print("very light")
print()
weight = float(input("Package weight (-1 to quit): "))
if weight == -1:
print("Thanks for using weight analyzer")
print()
def main():
weight = float(input("Package weight (-1 to quit): "))
analyzeWeight(weight)
main()