Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以解释这两者之间的区别吗?
data=[] for row in csv_file_object: data.append(row[1:])
和
data=[] for row in csv_file_object: data.append(row)
假设row = [1,2,3]:
row = [1,2,3]
然后:
row[1:]将是 [2,3]
row[1:]
row将是 [1,2,3]
row
前者不包括第一个元素。
解释