def hello_world():
print 'hello world'def three_hellos():
for i in range(3):
hello_world()if __name__ == '__main__':
three_hellos()
1 回答

tanhouyusheng
TA贡献94条经验 获得超59个赞
def hello_world():#这个函数的意思就是打印hello world
print 'hello world'
def three_hellos():#这个函数的意思就是运行上边的打印函数
for i in range(3):
hello_world()
if __name__ == '__main__':
#这是主函数,意思是调用那个打印三遍的函数,过程是先调用那个打印三遍的函数,然后那个函数调用三次打印函数
three_hellos()
添加回答
举报
0/150
提交
取消