为什么这么写只打印一个“HELLO”?
def toUppers(L):
# return [x.upper() for x in L if isinstance(x, str)]
for x in L:
if isinstance(x,str):
return x.upper()
print toUppers(['Hello', 'world', 101])
def toUppers(L):
# return [x.upper() for x in L if isinstance(x, str)]
for x in L:
if isinstance(x,str):
return x.upper()
print toUppers(['Hello', 'world', 101])
2018-06-27
举报