lst = [1, 2, 1 + 2, 2 > 3, 'Tom and Jerry'] print(lst) print(lst[-1][4:-2]) print(lst[-1][:-6:-1]) lst2 = ['A', 'B', 'C', ] lst.extend(lst2 * 3) # [1, 2, 3, False, 'Tom and Jerry', 'A', 'B', 'C', 'A', 'B', 'C', 'A', 'B', 'C'] print(lst)
赋值列表可以是表达式
标签:lst2,Jerry,列表,lst,print,操作,表达式 From: https://www.cnblogs.com/sangern/p/17409410.html