You have written the same print(f"Hello, {name}!") line three times in your code already. Not a big deal with one line. But what happens when the thing you keep repeating is 15 lines long? What happens when you find a bug in it and have to fix it in six different places? What happens when you forget to fix one of them? This is not a hypothetical. This is what happens in real codebases when people don't use functions. Code gets copied, pasted, modified slightly, and then something breaks and nobo
Comment
Sign in to join the discussion.
Loading comments…