Type conversion (int, float, string)
📖 Scenario: Imagine you are working in a small shop. You receive product prices as strings from the cashier's system, but you need to calculate totals and show prices properly formatted.
🎯 Goal: You will create variables with prices as strings, convert them to numbers to calculate totals, and then convert the result back to a string to display.
📋 What You'll Learn
Create variables with prices as strings
Create a variable to hold a discount rate as a float
Convert string prices to integers or floats for calculation
Calculate the total price after discount
Convert the total price back to a string for display
Print the final total price as a string
💡 Why This Matters
🌍 Real World
In shops or online stores, prices often come as text and need conversion to numbers for calculations like totals and discounts.
💼 Career
Understanding type conversion is essential for data processing, user input handling, and preparing data for calculations in many programming jobs.
Progress0 / 4 steps