What will be the output of the following Python function len(["hello",2, 4, 6])

1.  4

2.  3

3.  ERROR

4.  6

4

4

Explanation :
No Explanation available for this question

What will be the output of the following Python function oct(7) oct(‘7’)

1.  Error07

2.  0o7Error

3.  0o7Error

4.  070o7

4

0o7
Error

Explanation :
No Explanation available for this question

Which of the following is the use of function in python

1.  Functions are reusable pieces of programs

2.  Functions don’t provide better modularity for your application

3.  you can’t also create your own functions

4.  All of the mentioned

4

Functions are reusable pieces of programs

Explanation :
No Explanation available for this question

Which keyword is used for function

1.  Fun

2.  Define

3.  Def

4.  Function

4

Def

Explanation :
No Explanation available for this question

What will be the output of the following Python code def sayHello(): print('Hello World!') sayHello() sayHello()

1.  Hello World!Hello World!

2.  'Hello World!''Hello World!'

3.  HelloHello

4.  None of the mentioned

4

Hello World!
Hello World!

Explanation :
No Explanation available for this question

What will be the output of the following Python code def printMax(a, b): if a > b: print(a, 'is maximum') elif a == b: print(a, 'is equal to', b) else: print(b, 'is maximum') printMax(3, 4)

1.  3

2.  4

3.  4 is maximum

4.  None of the mentioned

4

4 is maximum

Explanation :
No Explanation available for this question

What will be the output of the following Python code x = 50 def func(x): print('x is', x) x = 2 print('Changed local x to', x) func(x) print('x is now', x)

1.  x is 50Changed local x to 2x is now 50

2.  x is 50Changed local x to 2x is now 2

3.  x is 50Changed local x to 2x is now 100

4.  None of the mentioned

4

x is 50
Changed local x to 2
x is now 50

Explanation :
No Explanation available for this question

What will be the output of the following Python code x = 50 def func(): global x print('x is', x) x = 2 print('Changed global x to', x) func() print('Value of x is', x)

1.  x is 50Changed global x to 2Value of x is 50

2.  x is 50Changed global x to 2Value of x is 2

3.  x is 50Changed global x to 50Value of x is 50

4.  None of the mentioned

4

x is 50
Changed global x to 2
Value of x is 2

Explanation :
No Explanation available for this question

What will be the output of the following Python code def say(message, times = 1): print(message * times) say('Hello') say('World', 5)

1.  HelloWorldWorldWorldWorldWorld

2.  HelloWorld 5

3.  HelloWorld,World,World,World,World

4.  HelloHelloHelloHelloHelloHello

4

Hello
WorldWorldWorldWorldWorld

Explanation :
No Explanation available for this question

What will be the output of the following Python code def func(a, b=5, c=10): print('a is', a, 'and b is', b, 'and c is', c) func(3, 7) func(25, c = 24) func(c = 50, a = 100)

1.  a is 7 and b is 3 and c is 10a is 25 and b is 5 and c is 24a is 5 and b is 100 and c is 50

2.  a is 3 and b is 7 and c is 10a is 5 and b is 25 and c is 24a is 50 and b is 100 and c is 5

3.  a is 3 and b is 7 and c is 10a is 25 and b is 5 and c is 24a is 100 and b is 5 and c is 50

4.  None of the mentioned

4