Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What is [::-1} used for?
Home
Python
What is [::-1} used for?
0
votes
asked
Oct 14, 2021
in
Python
by
rajeshsharma
What is [::-1} used for?
python-range
Python-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Oct 14, 2021
by
rajeshsharma
[::-1} reverses the order of an array or a sequence. However, the original array or the list remains unchanged.
import array as arr
Num_Array=arr.array('k',[1,2,3,4,5])
Num_Array[::-1]
Your comment on this answer:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Related questions
+1
vote
Q: If you have two sets like this -> s1 = {1,2,3,4,5,6}, s2 = {5,6,7,8,9}. How would you find the common elements in these sets.
asked
Feb 15, 2021
in
Python
by
SakshiSharma
#python-dataset
dataset
python
Python-questions-answers
0
votes
Q: Find out the mean, median and standard deviation of this numpy array -> np.array([1,5,3,100,4,48])
asked
Feb 11, 2021
in
Python
by
SakshiSharma
#python
python-meanm
python-numpy-array
Python-questions-answers
0
votes
Q: TypeError: only size-1 arrays can be converted to Python scalars
asked
Nov 15, 2020
in
Python
by
rajeshsharma
#python-string-error
#python-type-error
#type-error
Python-questions-answers
0
votes
Q: What data type is the object below ? L = [1, 23, ‘hello’, 1]
asked
Feb 11, 2020
in
Python
by
rahuljain1
#python-data-object
Python-questions-answers
0
votes
Q: What is the output of the expression : 3*1**3
asked
Feb 11, 2020
in
Python
by
rahuljain1
#python-expression
Python-questions-answers
0
votes
Q: What is the map() function used for in Python?
asked
Oct 12, 2021
in
Python
by
rajeshsharma
map-function-use
Python-questions-answers
0
votes
Q: Which of the following keywords is used for function declaration in Python language?
asked
Sep 29, 2021
in
Python
by
john ganales
function-declaration
Python-questions-answers
0
votes
Q: In the following options which are python libraries which are used for data analysis and scientific computations
asked
Sep 4, 2021
in
Python
by
SakshiSharma
python-libraries
Python-questions-answers
+1
vote
Q: What is split() function used for?
asked
Feb 13, 2021
in
Python
by
SakshiSharma
#python-split
split-method
split-python
python
Python-questions-answers
0
votes
Q: What are .pyc files used for?
asked
Jan 11, 2021
in
Python
by
SakshiSharma
#python-pyc-files
Python-questions-answers
...