## 用for循环遍历A = {‘1‘,‘2‘,‘star‘} for item in A: print(item,end=‘‘)
## 用while循环遍历A = {‘1‘,‘2‘,‘star‘} try: while True: print(A.pop(),end=‘‘) except: pass
python遍历集合的两种方式
原文:https://www.cnblogs.com/starboy13/p/12601916.html