I have this string, I am fairly new to python and I just need help doing this.
def this_sentence(My friend went on a tour)
I want the Output to look like this ['MY', 'FRIEND', 'WENT', 'ON', 'A', 'TOUR']
You can use str.upper()
to make all characters uppercase and then str.split()
to split the words at each space.
def this_sentence(sentence):
return sentence.upper().split()