您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

python中sets模块的用法实例

2024/4/11 2:32:21发布25次查看
本文实例简单讲述了python中sets模块的用法,分享给大家供大家参考。
具体方法如下:
import sets magic_chars = sets.set('abracadabra') print magic_chars poping_chars = sets.set('supercalifragilisticeexpialidocious') print poping_chars print .join(magic_chars & poping_chars)
程序运行结果如下:
set(['a', 'r', 'b', 'c', 'd'])set(['a', 'c', 'e', 'd', 'g', 'f', 'i', 'l', 'o', 'p', 's', 'r', 'u', 't', 'x'])acrd
希望本文所述对大家的python程序设计有所帮助。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product