Make Strings In List Uppercase - Python 3

Viewed 13532

I'm in the process of learning python and with a practical example I've come across a problem I cant seem to find the solution for. The error I get with the following code is 'list' object has to attribute 'upper'.

def to_upper(oldList):
    newList = []
    newList.append(oldList.upper())

words = ['stone', 'cloud', 'dream', 'sky']
words2 = (to_upper(words))
print (words2)
4 Answers
Related