What does [::-1} do?



What does [::-1} do?..

Answer / Vandana Bagi

[::-1] is a slice in Python that reverses the order of elements in a sequence like strings, lists, and tuples. For example, 'hello'[::-1] would return 'olleh'.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

Can I learn python on my own?

1 Answers  


Does python support database programming?

1 Answers  


What is string replication operator in python?

1 Answers  


Write a code to display the current time.

1 Answers  


What are the modes to open a file in python?

1 Answers  


Why is python faster than r?

1 Answers  


Why do you use abstract classes?

1 Answers  


What is the optional statement used in a try except statement in Python?

1 Answers  


Why is python used?

1 Answers  


How do you copy an object in python?

1 Answers  


How do you debug a python program?

1 Answers  


What is the use of numpy package?

1 Answers  


Categories