Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

for loop

newlist = []

for word in wordlist:
    newlist.append(word.upper())
    
# instead, use this:

newlist = map(str.upper, wordlist)
Source by www.kdnuggets.com #
 
PREVIOUS NEXT
Tagged: #loop
ADD COMMENT
Topic
Name
6+9 =