python学习5 函数
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import calendar
cal = calendar.month(2016, 1)
print ("以下输出2016年1月份的日历:")
print (cal)
def printme(str):
"打印传入的字符串到标准显示设备上"
print (str)
return
# 定义函数
def printme(str):
"打印任何传入的字符串"
print (str)
return
# 调用函数
printme("我要调用用户自定义函数!")
printme("再次调用同一函数")
def ch(a):
a.append([1,2,3,4])
print(a)
return
bb=[10,11,12]
print (ch(bb))

浙公网安备 33010602011771号