for 循环: l=['a','b','c'] for i in l : print(i) while循环和for循环 while循环:条件循环,循环的次数取决于条件何时为False for循环:循环的次数取决于数据的包含的元素的个数 for循环专门用来取值,在循环取值方面比while循环要强大,以后但凡遇到循环取值的场景,就应该用for循环 for+break names=['a','b','c','d'] for name in names: if name == 'c': break pr