Knowee
Questions
Features
Study Tools

What will be the output after the following statements?def call(var) : print(var, end ='') call(45)Options5545var4 5

Question

What will be the output after the following statements?def call(var) : print(var, end ='') call(45)Options5545var4 5

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

Solution

The output will be 45.

Here's the step by step explanation:

  1. A function named call is defined, which takes one argument var. This function prints the value of var without adding a newline at the end (due to end = '').

  2. The function call is called with the argument 45.

  3. The function prints 45 and since there is no newline character at the end, the cursor remains on the same line.

So, the output of the given code will be 45.

This problem has been solved

Similar Questions

What will be the output after the following statements? myvar = 5 def printvar(): print(myvar, end ='') printvar() printvar() Options 55 5 5 5 10

Test time left: 11:53 Choose the Correct Answer(s) What will be the output after the following statements? def call(y, x): return x / y z = call(4, 9) print(z) Options 0.444445 2 0 2.25

What will be the output after the following statements?def xyz(): a = 56 xyz() print(a)OptionsNameErrora = 56xyz56

What will be the output after the following statements?x = 'Python' print(x.join('33'))OptionsPython33Python3Python 333Python3

What will be the output of the following Python code?def ct(y): global y y+=2 print(y)ct(5)print("hi")Optionserrorhi77hi

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.