s = 'asdfghjklqwertyuiopzxcvbnm'
num = 1
for h in s:
num = num +1
if num >20:
break
print(h)
s = 'asdfghjklqwertyuiopzxcvbnm'
num = 1
for h in s:
num = num +1
if num >20:
break
print(h)
## 若要输出前二十位,注意print位置在if一级
s = 'asdfghjklqwertyuiopzxcvbnm'
num = 1
for h in s:
num = num +1
if num >20:
break
print(h)
输出print(h)要在循环里面。