首先需要定义元组,元组定义用英文(),它是一种不可改变的 T = ('abc',12,3.45,'python',2.789)
print(T)
print(T[-1])
print(T[1:3]) print("学号:2023310143008")
结果如下图所示: