1. 程式人生 > >元祖操作相關

元祖操作相關

and read spl list () upper range append 相關

#touple is only read and ont write

tu = (1,2,3,4,‘alex‘,[1,2,3,‘taibai‘],‘egon‘)
# print(tu[3])
# print(tu[0:3])
#
# for i in tu:
# print(i)

# tu[5][3] = tu[5][3].upper()
# print(tu[5])
# tu[5].append("sb")
# print(tu[5])
# s = "alex"
# s1 = "sb".join(s)
# print(s1)
#str ----->list split
#list------>str join
# li = ["taibai", "alex", "wusir"]
#
# s = ‘‘.join(li)
# print(s)

#range

# for i in range(10,0,-1):
# print(i)
#
# # li = range(0,10)
# # print(li)

元祖操作相關