CDA人工智能学院致力于以优质的人工智能在线教育资源助力学员的DT职业梦想!课程内容涵盖数据分析、机器学习、深度学习、人工智能、tensorFlow、PyTorch、知识图谱等众多核心技术及行业案例,让每一个学员都可以在线灵活学习,快速掌握AI时代的前沿技术。PS:私信我即可获取CDA会员1个月免费试听机会
python判断数组是否包含指定的元素的方法,直接使用in即可,python真是简单易懂
print 3 in [1, 2, 3] # membership (1 means true
inventory = ["sword", "armor", "shield", "healing potion"]
if "healing potion" in inventory:
print "You will live to fight another day."
运行结果如下:
True
You will live to fight another day.
希望本文所述对大家的Python程序设计有所帮助。
扫码关注CDA公众号,即可获取“最新版数据分析题库大全”与“CDA免费精品课70+”


雷达卡





京公网安备 11010802022788号







