Articles
The problem...
You've built the BMI Calculator before. It asked for input, calculated, and printed. One long block.
Now you have parameters. Same logic — but cleaner.
The…
The problem...
Your functions calculate things. They print things. But the result stays inside the function — and disappears when the function ends.
You can't use it. You …
The problem...
Your Username Generator function calculates and prints — all in one place. That works. But what if you want to use the username somewhere else? Store it. Pas…
The problem...
Your BMI Calculator calculates and prints — all in one function. But you can't use the BMI value anywhere else. You can't check the category. You can't store…
The problem...
You define a variable inside a function. You try to use it outside. Python says it doesn't exist.
Or you define a variable outside and try to change it inside a f…
The problem...
Your function calculates two things. But return sends back one value and stops.
You'd need two functions. Or you'd print one and return the other. Neither feels c…