Question: What will this code print? def add _ question ( words ) : new _ words = [ ] for word in words: if '

What will this code print?
def add_question(words):
new_words =[]
for word in words:
if 'q' in word:
word +='?'
new_words.append(word)
return new_words
def add_exclamation(words):
new_words =[]
for word in words:
if '?' in word:
word +='!'
new_words.append(word)
return new_words
words =["Quick!", "The", "queen", "asked", "a", "question!"]
words = add_question(words)
words = add_exclamation(words)
print(words[2])

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!