- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoop_class.py
More file actions
Latest commit
27 lines (20 loc) · 519 Bytes
/
Copy pathoop_class.py
File metadata and controls
27 lines (20 loc) · 519 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
# -*-coding:utf-8-*-
classPerson: # 一个空的代码块
"""
用户类
"""
def__init__(self, name):
"""文档字符串-函数描述"""
self.name=name
print("我的名字是:"+name)
defsay_hi(self):
"""问候方法"""
# print("你好:" + name)
print("你好:{}".format(self.name))
# p = Person('孙涛')
# print(p.say_hi())
#
# print(Person('文荟').say_hi())
#打印文档字符串
print(Person.__doc__)
print(Person.say_hi.__doc__)