What is the output of calling a list variable with a index range in Python?

Python code

thelist=['a','b']
print(thelist[3:])

output

[]

Even though the list has only 2 elements, the call to thelist with index 3 does not give any index error.


Posted

in

Tags:

Comments

Leave a Reply