write my assignment 4947

I need help with this code. i have run it already and know the answer but i want someone who can tell me more about how to trace this code. I can trace it from the beginning but get confuse at the end. Please you explanation should be well understood.

def justOnce(aString):

rtn = []

initials = []

words = aString.split()

for word in words:

initials.append(word[0])

for letter in initials:

if initials.count(letter) == 1:

rtn.append(letter)

return rtn

s = ‘Seventy six trombones led the big parade’

print(justOnce(s))

a. [‘S’, ‘s’, ‘l’, ‘t’, ‘b’, ‘p’]

b. [‘Seventy’, ‘six’, ‘led’, ‘big’, ‘parade’]

c. [‘s’, ‘l’, ‘b’, ‘p’] d. [‘S’, ‘s’, ‘l’, ‘b’, ‘p’]

e. None of the above

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"

Hi there! Click one of our representatives below and we will get back to you as soon as possible.

Chat with us on WhatsApp