形参和实参|默认值|可选实参|tuple|*tuple|args|*args | **kwargs|args[:]|
2024-09-03 23:45:47
#!/usr/bin/python def hello(i,greet='long time to see!'):
out = "hello "+i+" "+greet
nobody = {'as':'','ad':'','om':'ssss'}
if i == '':return nobody
return out name = 'we'
if hello('we')==hello(name)and hello('we')==hello(i= 'we'):
print "right!" #right! yoo = hello('ss','yoooo!')
print yoo #hello ss yoooo! for key in hello('','yoooo!').items():
print key
'''
('om', 'ssss')
('as', '123')
('ad', '1234')
'''
l = hello('')
print l l_1 = hello('')
l_2 = hello('')
print l_1
def printnumber(**arr):
for i in arr.values():
print i def pr(arr):
for i in arr.keys():
print i printnumber(a='alala',b='bababa',c= 'sksks')
pr(l_1)
'''
alala
sksks
bababa
''' a = [1,2,3,4]
b = ['a','b','c','d']
c = [a[:],b[:]] def cut(*a_1):
for i in a_1:
del i[1]
return a_1 print cut(c[:])
print a,b
print cut(a[:],b[:]) '''
([[1, 2, 3, 4]],)
[1, 2, 3, 4] ['a', 'b', 'c', 'd']
([1, 3, 4], ['a', 'c', 'd'])
'''
最新文章
- C# 时间转换 Windows的toFileTimeutc时间转换
- JavaScript—之对象参数的引用传递
- echarts .NET类库开源
- Redis List命令
- 使用cygwin出现syntax error near unexpected token'$'do\r
- Joy of Programming: Understanding Bit-fields in C
- WCF编程系列(六)以编程方式配置终结点
- Sql server 浅谈用户定义表类型
- JavaScript正则表达式之分组匹配 / 反向引用
- Servlet 易错点和注意点
- 通过工厂方法配置Bean
- MD5加密工具类
- vscode 创建.net core项目初体验
- rancher2.1.7安装nfs 存储类
- easyUI 创建详情页dialog
- openvas安装和基本使用
- 【BZOJ4310】跳蚤
- this语句的第三、四点
- MySql介绍
- js-判断当前日期的天数