Apr-21-2020, 12:58 PM
Hello guys, I'm facing some logic problems.
I barely know how to set max/min for order_weight and give order_price a variable then multiply it as well.
Please help me with this one. Thanks a lot!
These are the requirements.
set values for maximum and minimum order variables
set value for price variable
get order_amount input and cast to a number
check order_amount and give message checking against
over maximum
under minimum
else within maximum and minimum give message with calculated price
Sample input and output:
Enter cheese order weight (numeric value): 113
113.0 is more than currently available stock
Enter cheese order weight (numeric value): .15
0.15 is below minimum order amount
Enter cheese order weight (numeric value): 2
2.0 costs $15.98
I barely know how to set max/min for order_weight and give order_price a variable then multiply it as well.
Please help me with this one. Thanks a lot!
These are the requirements.
set values for maximum and minimum order variables
set value for price variable
get order_amount input and cast to a number
check order_amount and give message checking against
over maximum
under minimum
else within maximum and minimum give message with calculated price
Sample input and output:
Enter cheese order weight (numeric value): 113
113.0 is more than currently available stock
Enter cheese order weight (numeric value): .15
0.15 is below minimum order amount
Enter cheese order weight (numeric value): 2
2.0 costs $15.98
number = [0.15,120] weight_max = max(number) weight_min = min(number) x = 5 order_price = x * order_weight order_weight = input("Enter order chees weight :") if order_weight > weight_max: print(order_weight,"is more than currently available stock") elif order_weight < weight_min: print(order_weight,"is below minimum order amount") else: print("The cost is,",order_price)