摘要:
'''#def fib(n,a=1,b=1): if n==1 or n==2: return b elif n>=2: a,b=b,a+b return fib(n-1,a,b)ret=fib(10)print(ret)''''''#def fib(n): a,b=(1,1) while n>2: 阅读全文
摘要:
import osdef show_file(path): name_list=os.listdir(path) s=0 for name in name_list: abs_path=os.path.join(path,name) if os.path.isfile(abs_path): prin 阅读全文
摘要:
优先级:( )>not>and>or x or y x为真,值就是x,x为假,值是y; x and y x为真,值是y,x为假,值是x。 三元运算符: a if a>b else b ASCII: 英文: 8位,1个字节表示. GBK: 英文: 8位,1个字节表示. 中文: 16位,两个字节表示. 阅读全文
摘要:
import osstate=0name=""def wrapper(f): def inner(*args,**kwargs): if state==1: ret=f(*args,**kwargs) wel=ret[:3]+name+ret[3:] print(wel) return ret el 阅读全文