码迷,mamicode.com
首页 > 其他好文 > 详细

#判断是字符串、元组、列表且长度是否大于5

时间:2016-12-24 14:20:26      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:blog   字符串   nbsp   print   ret   als   tuple   python   字符   

 1 #!/usr/bin/env python
 2 def obj_len(arg) :
 3     if isinstance(arg,str) or isinstance(arg,list) or isinstance(arg, tuple) :
 4         if len(arg) >5 :
 5             return True
 6         else:
 7             return False
 8     return None
 9 temp = "qwewegfgsd"
10 ret = obj_len(temp)
11 print(ret)

 

#判断是字符串、元组、列表且长度是否大于5

标签:blog   字符串   nbsp   print   ret   als   tuple   python   字符   

原文地址:http://www.cnblogs.com/shiluoliming/p/6217076.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!