3

Python 检查一个变量是否序列类型

 3 years ago
source link: https://www.lfhacks.com/tech/python-check-if-sequence-type
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Python 检查一个变量是否序列类型

LFhacks.com

读万卷书,行万里路

Python 检查一个变量是否序列类型

扫一扫,用手机分享 qr.php?VnUAMAc6WygCIFcmUSFTOAJ9UX4Od1x1AiVYflVvUTEAPls3BjBSPgAlUn1SMgo0U25RfgR%2BCTIGNQ5uCHEKfFZ5AHkHOlszAjpXe1ExU2oCN1EyDmtcLwI7WDZVLlEkADNbJwYmUjAAOFIwUjQKdlN3USgEegkyBnAOcghjCj1WNgA%2FB2FbaQJmV2RRYlM1AmQ%3D
1566.jpg

from collections import Sequence
isinstance(a,Sequence) 

序列类型的具体解释: Python 中的 sequence 类型


坚持原创不易。如果您觉得有收获,请考虑资助本站,以期待更多原创文章。

打赏作者,支持小站
629.png
本站是个人博客。除非特别说明,所有文章均系原创,并采用 署名协议 CC-BY 授权。
欢迎转载,惟请保留原文链接:https://www.lfhacks.com/tech/python-check-if-sequence-type

©2011-2021    LFhacks.com    联系邮箱:LFhacks#qq.com    浙ICP备11058578号    Powered by Textpattern CMS


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK