Page MenuHomec4science

mylib.py
No OneTemporary

File Metadata

Created
Sun, Jul 6, 08:01

mylib.py

# Let's define class:
class MyLib:
"""
This is an example class.
"""
name = None
def __init__(self, name = "world"):
"""
The constructor will save the 'name' parameter to the 'name' attribute.
"""
self.name = name
def greet(self):
"""
This method greets the 'name' attribute with a hello message.
"""
print("Hello, {}!".format(self.name))
# EOF
# Let's add a global variable:
MyLibVariable = 3.14159265359
# EOF

Event Timeline