From 90b7b91c4597875b929a73392db7357afe039891 Mon Sep 17 00:00:00 2001 From: Hendrik Jäger Date: Tue, 1 Aug 2023 16:11:32 +0200 Subject: change greeting code to be a function --- src/hello/hello.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/hello/hello.py b/src/hello/hello.py index debf6e1..d56b4ae 100755 --- a/src/hello/hello.py +++ b/src/hello/hello.py @@ -2,6 +2,8 @@ import sys -who_to_greet = sys.argv[1] +def greet(who_to_greet: str): + print('Hello', who_to_greet) -print('Hello', who_to_greet) + +greet(sys.argv[1]) -- cgit v1.2.3