Discuss / Python / 3

七月上行

#1 Created at ... [Delete] [Delete and Lock User]

打印Apple:

print(L[0][0])

打印Python:

print(L[1][1])

打印Lisa:

print(L[2][2])

七月上行

#2 Created at ... [Delete] [Delete and Lock User]

不可变的tuple有什么意义?因为tuple不可变,所以代码更安全。如果可能,能用tuple代替list就尽量用tuple。


  • 1

Reply