Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could someone please help me alter my these two codes so they work work? Execution: ldike The following function make_exclamations is supposed to consume a

Could someone please help me alter my these two codes so they work work?

image text in transcribedimage text in transcribed

Execution: ldike The following function make_exclamations is supposed to consume a list of messages and return a new list of messages with exclamations at the end ("!" ). The function is defined and called twice, but as you can see, it seems to be returning the wrong value on subsequent runs. Diagnose the problem and fix the function's definition so that it returns the correct value each time Printer Feedback Instructor Feedback Your make exclamations function did not return the right value Given arguments: ['A B'] Expected return: ['A!, B!' Actually returned: ['Hi!', "I'm Klaus!" 'Woah!', Count these!', 'A! B!' Incorrect Answer Trace Variables 'Hi!', "I'm Klaus!"] m Klaus!" Woah!' . 'Count thes Run Blocks Split / Text Reset O Upload History I exclamations = [] 2 def make_exclamations (messages): for message in messages: 4 exclamations.append (message + "!") return exclamations 6 print(make_exclamations (["Hi", "I'm Klaus" ])) 7 print(make exclamations(["Woah", "Count these" 1)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What are the attributes of a technical decision?

Answered: 1 week ago

Question

How do the two components of this theory work together?

Answered: 1 week ago