Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

duplicate a list with for loop in python

her_clothes = ["women's trousers", "women's shirts", "women's shoes", "women's sunglasses"]
his_clothes = []

for clothes in her_clothes:
    his_clothes.append(clothes.replace("women's", "men's"))

print(his_clothes)

# output - ["men's trousers", "men's shirts", "men's shoes", "men's sunglasses"]
Comment

PREVIOUS NEXT
Code Example
Python :: tkinter convert Entry to string 
Python :: python import as 
Python :: standard deviation in python without numpy 
Python :: how to change an integer to a string in python permanently 
Python :: how to print a value of a key in nested dictionary python 
Python :: change a decimal to time in datetime python 
Python :: maximum recursion depth exceeded while calling a Python object 
Python :: how to find duplicates in csv file using python 
Python :: import one file into another python 
Python :: remove punctuation 
Python :: combine picture and audio python 
Python :: python string upper method 
Python :: pandas sum group by 
Python :: check if a word is a noun python 
Python :: nltk python how to tokenize text 
Python :: python add columns to dataframe without changing the original 
Python :: update python 2 to 3 
Python :: numpy maximum 
Python :: database with python 
Python :: pandas set hour for timestamp 
Python :: python test module 
Python :: matplotlib remove drawn text 
Python :: remove punctuation from a string 
Python :: python autoclick website 
Python :: python capitalize 
Python :: how to convert string into list in python 
Python :: parse email python 
Python :: How to add all the numbers of a list using python? 
Python :: print string in reverse order uing for loop python 
Python :: python pyttsx3 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =