From e3cb9b25acf51ab246b44c6ed846deba0f323f5b Mon Sep 17 00:00:00 2001 From: ZoyaQadeer Date: Sat, 19 Oct 2024 15:27:26 +0530 Subject: [PATCH] Update hello_world.py --- hello_world.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hello_world.py b/hello_world.py index b44a902..c43c2c5 100644 --- a/hello_world.py +++ b/hello_world.py @@ -1,6 +1,9 @@ # hello_world.py -def greet(): - print("Hello, Hacktoberfest!") + +def greet(name="Hacktoberfest"): + """Print a greeting to the user.""" + print(f"Hello, {name}!") if __name__ == "__main__": - greet() + user_name = input("Enter your name (or press Enter for default): ") + greet(user_name or "Hacktoberfest")