def obj_len(arg):
#isinstance(),判断是否是某一类
if isinstance(arg,str) or (isinstance(arg,list)) or (isinstance(arg,tuple)):
if len(arg) > 5:
return True
else:
return False
return None
temp = [123]
ret = obj_len(temp)
print(ret)
相关文章
- python -A*算法
- anaconda创建python3.10的虚拟环境失败或卡在Collecting package metadata (current_repodata.json)
- 获取python包的路径
- Python Conda报错:Collecting package metadata (current_repodata.json): failed
- python pip安装的包放在哪里(site-packages目录的位置)
- conda安装python3.5.2出错
- c#与python 交互(调用第三方库失败,自己奋战了三天以失败而结尾,但是还是有些干货)-如果有人弄出来请告诉我
- PowerShell 中激活anaconda的虚拟python环境
- python中的for循环如何控制步长
- python如何进入虚拟环境