If Statement Execution Flow
📖 Scenario: You are helping a small shop decide what message to show customers based on the amount they spend.
🎯 Goal: Build a simple program that uses if statements to check the amount spent and print the correct message.
📋 What You'll Learn
Create a variable called
amount_spent with the exact value 75Create a variable called
discount_threshold with the exact value 50Use an
if statement to check if amount_spent is greater than or equal to discount_thresholdPrint
"You get a discount!" if the condition is truePrint
"No discount this time." if the condition is false💡 Why This Matters
🌍 Real World
Stores and online shops often give discounts based on how much a customer spends. This helps encourage more buying.
💼 Career
Understanding if statements is key for any programming job because decisions in code depend on conditions.
Progress0 / 4 steps