python学习笔记---十二

#接收n个参数,返回最大值和最小值
def func(*args):
m = args[0]
mi = args[0]
for el in args:
if el > m:
m = el
if el < mi:
mi = el
return {"最大值":m, "最小值":mi}
print(func(1,2,3,4,5,6,7,8,89,10))

 

 

yanse = ["红心", "草花", "方块", "黑桃"]
dianshu = ["A","2","3","4","5","6"]
result = []
for el in yanse:
for dian in dianshu:
result.append((el,dian))

print(result)

上一篇:RMQ问题ST算法与模板


下一篇:jzoj 6273. 2019.8.4【NOIP提高组A】欠钱 (money)