- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex34.py
More file actions
Latest commit
21 lines (15 loc) · 576 Bytes
/
Copy pathex34.py
File metadata and controls
21 lines (15 loc) · 576 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'''
练习函数调用。
(通俗的理解_name_ == '_main_':假如你叫小明.py,在朋友眼中,
你是小明(_name_ == '小明');在你自己眼中,你是你自己(_name_ == '_main_')。
if _name_ == '_main_'的意思是:当.py文件被直接运行时,if _name_ == '_main_'
之下的代码块将被运行;当.py文件以模块形式被导入时,if _name_ == '_main_'
之下的代码块不被运行。)
'''
defhello():
print("hello, world!")
defthree_hello():
foriinrange(3):
hello()
if__name__=="__main__":
three_hello()