python第八篇之-函数(1)

来源:互联网 发布:深圳资深淘宝客服 编辑:程序博客网 时间:2024/06/06 00:00



#!/usr/bin/pythondef sayhello():    print('hello world')sayhello()sayhello()s = input()print(s)

这里定义一个函数:

def sayhello():    print('hello world')
这里的函数功能就是打印一句hello world

然后调用两次:

sayhello()sayhello()