summaryrefslogtreecommitdiffstats
path: root/ExampleSubmission
diff options
context:
space:
mode:
Diffstat (limited to 'ExampleSubmission')
-rw-r--r--ExampleSubmission/animals.py22
-rw-r--r--ExampleSubmission/example.py11
2 files changed, 32 insertions, 1 deletions
diff --git a/ExampleSubmission/animals.py b/ExampleSubmission/animals.py
new file mode 100644
index 0000000..10c1cb4
--- /dev/null
+++ b/ExampleSubmission/animals.py
@@ -0,0 +1,22 @@
+import datetime
+
+class Animal:
+ def __init__(self):
+ self.birthday = datetime.datetime.now()
+
+ def move(self):
+ return "*moves*"
+
+class Dog(Animal):
+ def speak(self):
+ return "woof"
+
+class Cat(Animal):
+ def speak(self):
+ return "meow"
+
+class Kitten(Cat):
+ """nyaa~~~
+ """
+ def speak(self):
+ return "meow (but cuter)"
diff --git a/ExampleSubmission/example.py b/ExampleSubmission/example.py
index b64c98d..a226adb 100644
--- a/ExampleSubmission/example.py
+++ b/ExampleSubmission/example.py
@@ -1,3 +1,6 @@
+# Eden Attenborough
+# 12-01-21
+
import tkinter as tk
class Application(tk.Tk):
@@ -8,7 +11,7 @@ class Application(tk.Tk):
self.title("Hello World!")
- def a_method_with_defaults(self, arg_1 = "hello", arg_2 = "world"):
+ def a_method_with_defaults(self, n:str, arg_1 = "hello", arg_2 = "world", count:int = 3):
"""Adds two strings together with a space between them.
Args:
@@ -32,6 +35,7 @@ class Application(tk.Tk):
"""
return num1 + num2
+# hello world!
def hello_world(times):
"""Prints 'hello world!' to stdout. Prints it out `times` times.
@@ -46,6 +50,11 @@ def hello_world(times):
def an_undocumented_function():
return 3.14156
+# kwonlyargs demo
+def greet(*names, greeting="Hello"):
+ for name in names:
+ print(greeting, name)
+
if __name__ == "__main__":
app = Application()
app.mainloop() \ No newline at end of file