摘要:
# 元祖 ,只读列表,可存大量数据,可以索引,切片(步长) # example: # (1,2,'100','simon',[4,5,6]) # 元祖没有增删改,只能读 # tu = (1,2,'100','simon',[4,5,6]) # print(tu[2]) # print(tu[::2] 阅读全文
摘要:
l1 = [1,2,'simon',[1,'hukey',3]] # 1. 将l1中的simon变成大写并放回原处 # l1[2] = l1[2].upper() # print(l1) # 结果 # [1, 2, 'SIMON', [1, 'hukey', 3]] # 2. 给小列表[1,'huk 阅读全文
摘要:
# s1 = 'hukey yuanming' # print(s1[-1:-3:-1]) # # print(s1.upper()) # print(s1.lower()) # s1.split() # l1 = [ 100,'simon',True,[1,2,3] ] #承载任意数据类型 # P 阅读全文