diff options
author | Zhongheng Liu <z.liu@outlook.com.gr> | 2025-02-18 11:58:46 +0200 |
---|---|---|
committer | Zhongheng Liu <z.liu@outlook.com.gr> | 2025-02-18 11:58:46 +0200 |
commit | 34bd7099d27656b4454015b0c410ca1713db5271 (patch) | |
tree | b2705e345e490932c7f6284b056549c6a3963cc4 /oop/oop2.py | |
parent | 5e297261b05ed2c3feef0a892fc47e5fa06dbc4c (diff) | |
download | cs-y13-34bd7099d27656b4454015b0c410ca1713db5271.tar.gz cs-y13-34bd7099d27656b4454015b0c410ca1713db5271.tar.bz2 cs-y13-34bd7099d27656b4454015b0c410ca1713db5271.zip |
feat: add activity 20h
Diffstat (limited to 'oop/oop2.py')
-rw-r--r-- | oop/oop2.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/oop/oop2.py b/oop/oop2.py new file mode 100644 index 0000000..f764420 --- /dev/null +++ b/oop/oop2.py @@ -0,0 +1,7 @@ +class greeting: + def hello(self, fname = None, lname = None): + print(f"Hello {fname if fname else ''} {lname if lname else ''}!") +g = greeting() +g.hello() +g.hello("John") +g.hello("John", "Doe") |