Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120688558
mylib.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jul 6, 08:01
Size
525 B
Mime Type
text/x-python
Expires
Tue, Jul 8, 08:01 (2 d)
Engine
blob
Format
Raw Data
Handle
27230246
Attached To
rNOTOPOCNB noto-poc-notebooks
mylib.py
View Options
# 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
Log In to Comment