索罗斯7922145
2022-04-24 11:51
# 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
Python3 入门教程(新版)
154155 学习 · 1075 问题
相似问题