summaryrefslogtreecommitdiff
path: root/_legacy/oop/oop2.py
diff options
context:
space:
mode:
authorZhongheng Liu <z.liu@outlook.com.gr>2025-02-19 09:43:52 +0200
committerZhongheng Liu <z.liu@outlook.com.gr>2025-02-19 09:43:52 +0200
commit8834da60a01294fd509c7cebf3b129fcc378d152 (patch)
treea1c6c4bd71e95780f87d35240754c5b54d3042ae /_legacy/oop/oop2.py
parent34bd7099d27656b4454015b0c410ca1713db5271 (diff)
downloadcs-y13-8834da60a01294fd509c7cebf3b129fcc378d152.tar.gz
cs-y13-8834da60a01294fd509c7cebf3b129fcc378d152.tar.bz2
cs-y13-8834da60a01294fd509c7cebf3b129fcc378d152.zip
chore: changing to ipynb
Diffstat (limited to '_legacy/oop/oop2.py')
-rw-r--r--_legacy/oop/oop2.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/_legacy/oop/oop2.py b/_legacy/oop/oop2.py
new file mode 100644
index 0000000..f764420
--- /dev/null
+++ b/_legacy/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")