为什么会有格式错误
def demo(s):
result = [0,0]
for ch in s:
if 'a'<=ch<= 'z':
result[1] += 1
elif 'A'<=ch<='Z':
result[0] += 1
return result
print (demo('aaabbCsC'))
for ch in s: 冒号有问题
def demo(s):
result = [0,0]
for ch in s:
if 'a'<=ch<= 'z':
result[1] += 1
elif 'A'<=ch<='Z':
result[0] += 1
return result
print (demo('aaabbCsC'))
for ch in s: 冒号有问题
2018-09-28
举报