Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

What is slicing in list (in python 3) ? And what is it used for. Give one example.

0 votes
asked Jan 6 by Pallabesh Maharana (440 points)

1 Answer

+1 vote
answered Jan 6 by Peter Minarik (15,580 points)
selected Jan 6 by Pallabesh Maharana
Best answer

With slicing you can access a specific range in a list (or tupe or array).

list[start:end] # slice the list including start and excluding end

Please, have a look at these for details:

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.