Just like you use a calculator for your daily accounts, you can perform math in programming. Think of it as telling the computer to do calculations for you, like a shopkeeper in a village market totaling a customer's bill.
Story: You can add numbers together using the `+` sign. This is useful for totaling items.
The Code: total_cost = 50 + 25
Story: Use the `-` sign to subtract one number from another, like calculating the remaining stock.
The Code: stock_left = 100 - 30
Story: Use the `*` sign (asterisk) to multiply numbers, like calculating the total price for multiple items.
The Code: total_price = 10 * 5 (for 5 items costing 10 each)
Story: Use the `/` sign to divide numbers, like sharing a profit among partners.
The Code: profit_per_person = 1000 / 4
# Calculating the cost of mangoes and bananas
mango_cost = 150
banana_cost = 40
total = mango_cost + banana_cost
print("Total cost is:", total)
# Calculating how many boxes are needed
mangoes_per_box = 12
total_mangoes = 240
boxes_needed = total_mangoes / mangoes_per_box
print("Boxes needed:", boxes_needed)
Which symbol is used for multiplication in programming?