What does [::-1] do?

+1 vote
Does [::-1] reverse a the original order of data structures like lists or arrays?
Jun 6 in Python by Fata
• 360 points
16 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
+1 vote
[::-1] does not reverse the order of the elements present in the original data structure, but it creates a reversed copy of d same and stores it separately.
answered Jun 6 by Nisa
• 640 points

Related Questions In Python

0 votes
1 answer

What to do when len() does not return the number of integers in range(1,100)?

You can use the following code block: x=range(1,100) len(x) Output: ...READ MORE

answered May 28 in Python by Fata
• 360 points
13 views
0 votes
1 answer

What exactly does the .join() method do?

Look carefully at your output: 5wlfgALGbXOahekxSs9wlfgALGbXOahekxSs5 ^ ...READ MORE

answered May 30, 2018 in Python by charlie_brown
• 7,710 points
15 views
0 votes
1 answer

What does if __name__ == “__main__”: do?

According to what I know,  When the Python ...READ MORE

answered Jul 30, 2018 in Python by Priyaj
• 56,140 points
49 views
0 votes
1 answer

What does eval() in Python do?

The eval function lets a Python program ...READ MORE

answered Aug 24, 2018 in Python by Priyaj
• 56,140 points
25 views
0 votes
1 answer

What does the return statement do in Python?

The print() function is use to write ...READ MORE

answered Oct 1, 2018 in Python by SDeb
• 10,860 points
37 views
0 votes
1 answer

What exactly does the .join() method do?

Look carefully at your output: 5wlfgALGbXOahekxSs9wlfgALGbXOahekxSs5 ^                 ^                 ^ I've ...READ MORE

answered Oct 10, 2018 in Python by SDeb
• 10,860 points
14 views
0 votes
1 answer

What does hash do in python?

A hash is an fixed sized integer ...READ MORE

answered Oct 15, 2018 in Python by SDeb
• 10,860 points
21 views
+3 votes
2 answers

What does Python _init_ and self do?

Hey @Anirudh!  Self The self keyword is used to access ...READ MORE

answered Oct 31, 2018 in Python by Omkar
• 66,910 points
54 views
0 votes
2 answers

What is the difference between python lists and arrays?

Python arrays and lists have the same ...READ MORE

answered Jun 10 in Python by Nisa
• 640 points
24 views
0 votes
1 answer

What is the purpose of using lambda functions in Python?

The main purpose of anonymous functions come ...READ MORE

answered Jun 11 in Python by Nisa
• 640 points
17 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.