# Enter a code
s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
num = 10
for ch in s:
if num>=10
print(ch)
num = num + 1
结果
print那一行缩进有问题,前面的if语句后面没有: 说明你if语句就不完整
s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
num = 0
for ch in s:
if num >= 10:
print(ch)
num = num + 1
s ='ABCDEFGHIJKLMNOPQRSTUVWXYZ' num = 1 for ch in s: if num>=10: print(ch) num = num + 1 else: num = num + 1
if 后面没有冒号,print要indent