Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

rearrange list python

a_list = ["a", "b", "c"]
order = [1, 0, 2]

a_list = [a_list[i] for i in order]

print(a_list) #['b', 'a', 'c']
Comment

PREVIOUS NEXT
Code Example
Python :: convert file to base64 python 
Python :: write txt python 
Python :: lru cache python 
Python :: python nameerror input 
Python :: get hwid python 
Python :: pyspark save machine learning model to aws s3 
Python :: how to change colour of rows in csv using pandas 
Python :: list to tensor 
Python :: triangle pattern in python 
Python :: urllib.error.HTTPError: HTTP Error 403: Forbidden 
Python :: python open dicom 
Python :: check cuda available tensorflow 
Python :: txt file duplicate line remover python 
Python :: how to make any player hit a ball using python turtle 
Python :: the four pillars of Op in Python 
Python :: how to make player quit in python 
Python :: python read file in string list 
Python :: how to wait in pygame 
Python :: how to make a pygame window 
Python :: how to add card in py-trello 
Python :: python conditional assignment 
Python :: requests get cookies from response 
Python :: how to color print in python 
Python :: python for each attribute in object 
Python :: get most recent file in directory python 
Python :: how to get the current url path in django template 
Python :: jupyter themes 
Python :: remove jupyter environment 
Python :: Test Speed internet using Python 
Python :: flask hello world 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =