tuple1 = (1, 2, 3, 4, 5, 6, 7,8) temp = () temp1 = (1, 2, 3) temp2 = 1, 2, 3 print(type(temp1)) print(type(temp2)) # ,是tuple的关键
tuple不可以修改,可以通过切片和+进行插入,通过del完全删除
tuple1 = (1, 2, 3, 4, 5, 6, 7,8) temp = () temp1 = (1, 2, 3) temp2 = 1, 2, 3 print(type(temp1)) print(type(temp2)) # ,是tuple的关键
tuple不可以修改,可以通过切片和+进行插入,通过del完全删除