Python ProgrammingPython Programming

Calculate total weight of an order

Write a program in python that reads the number of jeans and the number of t-shirts in an order from the user. Then your program should compute and display the total weight of the order.
##
#Python's program to calculate total weight of the order.  
##

#Define the constants
T_SHIRT	= 300
JEANS	= 400


#Read the input from user
print("Enter your order items:")
num_tshirt = int(input(" Number of T-Shirts: "))
num_jeans  = int(input(" Number of Jeans: "))

#Compute total order weight
total_weight = num_tshirt*T_SHIRT + num_jeans*JEANS

#Display the result
print("Your order total weight is:",total_weight,"gm")
Sample output of above program.
C:\Python\programs>python program4.py
Enter your order items:
Number of T-Shirts: 3
Number of Jeans: 4
Your order total weight is: 2500 gm

C:\Python\programs>