Students can try following practice first:
float price and int quantity; print total and average price and practice // and % with “boxing” problems (items per box and remainder).Answer examples:
1.Three-Score Summary:
print("=== Three-Score Summary ===")
s1 = float(input("Score 1: "))
s2 = float(input("Score 2: "))
s3 = float(input("Score 3: "))
total = s1 + s2 + s3
avg = total / 3
print("Total =", total)
print("Average =", round(avg, 2)) # 2 decimal
2.Shopping List & Boxing Problem:
print("=== Shopping List ===")
price1 = float(input("Enter price of item 1: "))
qty1 = int(input("Enter quantity of item 1: "))
price2 = float(input("Enter price of item 2: "))
qty2 = int(input("Enter quantity of item 2: "))
price3 = float(input("Enter price of item 3: "))
qty3 = int(input("Enter quantity of item 3: "))
total = price1 * qty1 + price2 * qty2 + price3 * qty3
avg_price = (price1 + price2 + price3) / 3
print("Total cost =", total)
print("Average item price =", round(avg_price, 2))
print("n=== Boxing Problem ===")
items = int(input("Enter total number of items: "))
box_size = int(input("Enter number of items per box: "))
full_boxes = items // box_size
remainder = items % box_size
print("You can fill", full_boxes, "boxes completely.")
print("Remaining items that don’t fit in a box:", remainder)