fork download
  1. # your code goes here
  2.  
  3.  
  4. L1 = ['Hello', 'World', 18, 'Apple', None]
  5. L2 = [s.lower() for s in L1 if isinstance(s,str) ]
  6.  
  7. # 测试:
  8. print(L2)
  9. if L2 == ['hello', 'world', 'apple']:
  10. print('测试通过!')
  11. else:
  12. print('测试失败!')
  13. # your code goes here
Success #stdin #stdout 0.09s 14172KB
stdin
Standard input is empty
stdout
['hello', 'world', 'apple']
测试通过!