Intermediate
Explain Code Logic
Break down a piece of code to understand its functionality.
📝 Conteúdo do Prompt
Explain what the following code snippet does line-by-line: def calculate_discount(price, discount_rate): return price * (1 - discount_rate). Assume the audience is a beginner programmer.