Python code Your should promt user to enter a weight of almo

Python code: Your should promt user to enter a weight of almonds in lbs. The program should take float point values like 10.5. Based on the weight, the program must output a level using the following rule - any amount up to and including 30 means a level D. More than 30 but less than 80 is level C. 80 to 110 is level B. More than 100 is level A. Use only names constants for all constants. Decision logic should use multiple alternatives

Solution

val=input(\"Enter weight in pounds\ \")


if val<=30:
   print \"Level D\"
elif val >30 and val <80:
   print \"Level C\"
elif val >=80 and val <=100:
   print \"Level B\"
else:
   print \"Level A\"

============================================================

akshay@akshay-Inspiron-3537:~/Chegg$ python pound.py
Enter weight in pounds
123
Level A

Python code: Your should promt user to enter a weight of almonds in lbs. The program should take float point values like 10.5. Based on the weight, the program

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site