From: Hendrik Jäger Date: Tue, 1 Aug 2023 14:11:32 +0000 (+0200) Subject: change greeting code to be a function X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=90b7b91c4597875b929a73392db7357afe039891;p=user%2Fhenk%2Fcode%2Fpython%2Flearn_python.git change greeting code to be a function --- 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])