Question

What will be the output of the following Python code: a=[1,2,3,4,5,6] print(a[-1],a[-1:],a[:-1])

A [6] [6] [1,2,3,4,5,6]
B 6 [6] [6,5,4,3,2,1]
C 6 [6] [1,2,3,4,5]
D 6 [6] [6,5,4,3,2]
Practice Next

Hey! Ask a query