摘要: Python 集合(Sets)2 访问项 您无法通过引用索引或键来访问集合中的项。但是,您可以使用for循环遍历集合项,或者使用in关键字检查集合中是否存在指定的值。 示例,遍历集合并打印值: thisset = {"apple", "banana", "cherry"} for x in thisset: print(x) 示例, 阅读全文
posted @ 2023-10-12 21:30 小万哥丶 阅读(62) 评论(0) 推荐(0)