Questions

M.C.Q

🎯

Test yourself on this topic

8 questions · timed · auto-graded

MCQ 11 Mark
If a function doesn't have a return statement, which of the following does the function return?
  • A
    int
  • B
    null
  • none
  • D
    An exception is thrown without the return statement
Answer
Correct option: C.
none
View full question & answer
MCQ 21 Mark
What is a variable defined inside a function referred to as?
  • A
     A static variable
  • B
    A global variable
  • A local variable
  • D
    An auto variable
Answer
Correct option: C.
A local variable
View full question & answer
MCQ 31 Mark
What is a variable defined outside a function referred to as?
  • A
     A static variable
  • A global variable
  • C
    A local variable
  • D
    An auto variable
Answer
Correct option: B.
A global variable
View full question & answer
MCQ 41 Mark
What is the output of the functions shown below?min(max(False, -3,-4),2,7)
  • -3
  • B
    -4
  • C
    true
  • D
    0
Answer
Correct option: A.
-3
a.
View full question & answer
MCQ 51 Mark
What will be the output of the following code?import math
abs(math.sqrt(25))
  • A
    5
  • 5.0
  • C
    Error
  • D
    No output
Answer
Correct option: B.
5.0
5.0
View full question & answer
MCQ 71 Mark
What will be the output of the following code :print type(type(int))
  • A
    type 'int'
  • type 'type'
  • C
    Error
  • D
    null
Answer
Correct option: B.
type 'type'
type 'type'
View full question & answer
MCQ 81 Mark
Which of the following is the use of id() function in python?
  • Id returns the identity of the object
  • B
    Every object doesn't have a unique id
  • C
    All of the mentioned
  • D
    None of the mentioned
Answer
Correct option: A.
Id returns the identity of the object
Id returns the identity of the object
View full question & answer
M.C.Q - Computer Science STD 12 Science Questions - Vidyadip