medium
Explain Code Logic
Break down a specific Python function for a beginner.
📝 Prompt Content
Explain the logic of the following Python function step-by-step as if you were teaching a beginner programmer. Define what the inputs and outputs represent: def calculate_discount(price, discount_rate): return price * (1 - discount_rate)