Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

remove whitespace in keys from dictionary

sample_dictionary={'Ballaji 05': 'QA', 'Priya 06': 'QA tech'}
sample_dictionary={key.replace(" ",""):value
                   for key,value in sample_dictionary.items()
                   }
print(sample_dictionary)
>>{'Ballaji05': 'QA', 'Priya06': 'QA tech'}
Comment

PREVIOUS NEXT
Code Example
Python :: python read arguments 
Python :: feet to meter python 
Python :: run python script from c# 
Python :: python get all ips in a range 
Python :: python read png file 
Python :: how to delete a turtle in python 
Python :: python check if image is corrupted 
Python :: dire Bonjour en python 
Python :: python color text console 
Python :: pandas filter rows by value in list 
Python :: create temporary files in python 
Python :: how to use enumerate instead of range and len 
Python :: log base in python 
Python :: Consider using python 3 style super without arguments 
Python :: how to increase size of graph in jupyter 
Python :: python live radio 
Python :: django admin image 
Python :: scipy correlation 
Python :: finding the format of an image in cv2 
Python :: loop rought rows in pands 
Python :: python sorting array without inbuilt sort 
Python :: python column = sum of list of columns 
Python :: python lowercase 
Python :: python3 return a list of indexes of a specific character in a string 
Python :: sqlalchemy create engine PostgreSQL 
Python :: python maths max value capped at x 
Python :: pandas read chunk of csv 
Python :: raise an APi error on django rest view 
Python :: python numpy arrays equal 
Python :: print hello world python 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =