-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello_python.py
More file actions
40 lines (30 loc) · 790 Bytes
/
hello_python.py
File metadata and controls
40 lines (30 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
The mod module
@author: rajendrap
@date: Jan 31, 2016
"""
class HelloPython(object):
"""
hello world in python
"""
def __init__(self, user_name=None, user_age=None):
self.user_name = user_name
self.user_age = user_age
def hello_user(self):
"""
A method defination, always called with instance, requires to pass self.
"""
print(self.user_name)
def hello_python(self):
"""
A method defination, always called with instance, requires to pass self.
"""
print(self.user_name)
def hello_python():
"""
A function definition, doesn't require instance to call.
"""
print('Hello Python!!')
HELLO_PYTHON = HelloPython('Peter')
HELLO_PYTHON.hello_user()
hello_python()