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 |
Can I learn python on my own?
Does python support database programming?
What is string replication operator in python?
Write a code to display the current time.
What are the modes to open a file in python?
Why is python faster than r?
Why do you use abstract classes?
What is the optional statement used in a try except statement in Python?
Why is python used?
How do you copy an object in python?
How do you debug a python program?
What is the use of numpy package?