Python(四十八)——list

Python(四十八)——list

特殊的点

    a = [1,2]
    a = a + (3,4) #会报错,TypeError: can only concatenate list (not "tuple") to list
    
    #+=实际就是调用了extend方法,不会报错
    a += (3,4)
    a.extend((5,6))

猜你喜欢

转载自blog.csdn.net/zxq6661/article/details/118075001