Example & Tutorial understanding programming in easy ways.

Is following Python code gives an error ? l=[1,2,3,4] print(l[10:])

No this code is not give any error because we can not try to direct fetch 10th index value so it will not give IndexError

-We use slicing here so that it can't give any error. 

Read More →