Knowee
Questions
Features
Study Tools

What is the output of the following display() function calldef display(**kwargs):    for i in kwargs:        print(i)display(emp="Kelly", salary=9000)TypeErrorKelly9000(’emp’, ‘Kelly’)(‘salary’, 9000)empsalary

Question

What is the output of the following display() function calldef display(**kwargs):    for i in kwargs:        print(i)display(emp="Kelly", salary=9000)TypeErrorKelly9000(’emp’, ‘Kelly’)(‘salary’, 9000)empsalary

🧐 Not the exact question you are looking for?Go ask a question

Solution

The output of the given function call will be:

emp salary

This is because the function display() is designed to print the keys of the keyword arguments (kwargs) it receives. In the function call, "emp" and "salary" are the keys, so these are the ones that get printed.

Similar Questions

What is the output of the following display_person() function calldef display_person(*args):    for i in args:        print(i)display_person(name="Emma", age="25")

What is the output of the following function calldef fun1(name, age=20):    print(name, age) fun1('Emma', 25)Emma 25Emma 20Emma 22

What do these lines print?>>> def my_function(counter=89):>>> return counter + 1>>> >>> print(my_function())18990891

what is the output of following python code? class myclass:    def display(self,a):        print(a)o=myclass()o.display("Hello World")

The following is displayed by a print function call. Select all of the function calls that result in this output.krishramgopalOptionsprint('''krish\nram\ngopal''')print(”’krishramgopal”’)print(‘krish\nram\ngopal’)print('krishramgopal')

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.