len字符串的长度
1 #!/usr/bin/env python 2 def fun4(x) : 3 if len(x) > 2 : 4 5 return print(x[0],x[1]) 6 else: 7 return 0 8 9 d = ('sa','a','safds','aaasda') 10 fun4(d)
1 def fun2(x) : 2 if len(x) > 5 : 3 return True 4 else : 5 return False 6 7 8 s = ["w","w"] 9 rr = fun2(s) 10 print(rr)