python:
交换 a,b = b,a
输出 print('data:{:12,.2f}'.format(data))
print(data1,data2,data3,sep = '|')
print(data,end = ',')
Lamda:
hello = lambda:print('hello world')
hello();
scores = [1,2,3,4]
scores_ = list(map(lambda n: n+3,scores))
map:
filter:
scores = [55,35,85,77,44,92]
def check_score(n):
return n < 60
r = list(filter(check_score,scores))
r = list(filter(lambda n : n < 60,scores))
python tkinter 的button如何传参:
import Tkinter
def helloworld(a):
print("hello {0}".format(a))
top = Tkinter.Tk()
B = Tkinter.Button(top,text="click",command=lambda:helloworld(1))
B.pack()
top.loop()