Discuss / Python / isinstance 和 type

isinstance 和 type

Topic source

L2 = [n.lower() for n in L1 if isinstance(n,str)]

L2 = [n.lower() for n in L1 if type(n) == str]


  • 1

Reply