for的循環(huán)
name = 'dongGe'
for x in name:
print('----')
print(x)
帶有break的循環(huán)
name = 'dongGe'
for x in name:
print('----')
if x == 'g':
break
print(x)
while的循環(huán)
i = 0
while i<10:
i = i+1
print('----')
print(i)
帶有break的循環(huán)
i = 0
while i<10:
i = i+1
print('----')
if i==5:
break
print(i)#
continue的循環(huán)
for的循環(huán) name = 'dongGe'
for x in name:
print('----')
if x == 'g':
continue
print(x)
i = 0
while i<10:
i = i+1
print('----')
if i==5:
continue
print(i)