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)

Question

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

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

Solution

The output of the given function call will be:

emp salary

Explanation: The function display() is defined with **kwargs as a parameter, which allows it to accept any number of keyword arguments. In the function body, a for loop is used to iterate over these keyword arguments. The variable 'i' will take on the key of each keyword argument.

When the function is called with the keyword arguments emp="Kelly" and salary=9000, the for loop will first print the key 'emp', then it will print the key 'salary'.

This problem has been solved

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 is the output of following python code? class myclass:    def display(self,a):        print(a)o=myclass()o.display("Hello World")

What does the following program print?void f(int *p, int *q) { p = q; *p = 2;}int i = 0, j = 1;int main() { f(&i, &j); printf("%d %d \n", i, j); getchar(); return 0;}Options2 22 10 10 2

ct answerWhat is the output of the following code snippet?printf("%f", 3 / 2);

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.