From 803053ab9b165b28dd85421b8a6b9e79ad075e54 Mon Sep 17 00:00:00 2001 From: dongyi Date: Sun, 23 Mar 2025 22:45:12 +0900 Subject: [PATCH 1/2] Add: user_name by input() --- helloworld.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helloworld.py b/helloworld.py index 3ea949e..76dca2a 100644 --- a/helloworld.py +++ b/helloworld.py @@ -3,4 +3,5 @@ """ if __name__ == '__main__': - print('Hello, World!') \ No newline at end of file + user_name = input('What is your name? ') + print('Hello ' + user_name + '!') \ No newline at end of file From c829a9d32c5219607649de3faafa0e4e43551ba3 Mon Sep 17 00:00:00 2001 From: dongyi Date: Sun, 23 Mar 2025 22:51:44 +0900 Subject: [PATCH 2/2] refactor: use f-string --- helloworld.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helloworld.py b/helloworld.py index 76dca2a..7a09edf 100644 --- a/helloworld.py +++ b/helloworld.py @@ -4,4 +4,4 @@ if __name__ == '__main__': user_name = input('What is your name? ') - print('Hello ' + user_name + '!') \ No newline at end of file + print(f'Hello {user_name}!') \ No newline at end of file