1.unpacking 使用类似tuple的形式多项赋值,而不是逐项: list1 = ['hello','world','python','java'] # h = list1[0] # w = list1[1] h,w = list1[:2] 2. 使用join来代替字符串拼接生成新对象 colors = ['red', 'blue', 'green', 'yellow'] # result = '',for s in color,result += s result = ''.join(…