题目:练习函数调用。
程序分析:使用函数,输出三次 RUNOOB 字符串。
实例
#!/usr/bin/python# -*- coding: UTF-8 -*-defhello_runoob(): print('RUNOOB')defhello_runoobs(): foriinrange(3): hello_runoob()if__name__ == '__main__': hello_runoobs()
以上实例输出结果为:
RUNOOB
RUNOOB
RUNOOB
题目:练习函数调用。
程序分析:使用函数,输出三次 RUNOOB 字符串。
#!/usr/bin/python# -*- coding: UTF-8 -*-defhello_runoob(): print('RUNOOB')defhello_runoobs(): foriinrange(3): hello_runoob()if__name__ == '__main__': hello_runoobs()
以上实例输出结果为:
RUNOOB
RUNOOB
RUNOOB