Python - MCQ

Multiple Choice Questions


Share with a Friend

 

Python - Multiple Choice Questions (MCQ) - Introduction & syntax of Python - Set 4

16. Which of these is not a core data type? 
A). Lists
B). Dictionary
C). Tuples
D). Class
View Answer
Correct: D



17. What data type is the object below? L = [1, 23, 'hello', 1]
A). list
B). dictionary
C). array
D). tuple
View Answer
Correct: A


18. Which function is used to take input in python? 
A). scanf()
B). int()
C). promt()
D). input()
View Answer
Correct: D



19. The ‘in’ operator is used to check if a value exists within an iterable object container such as a list. Evaluates to true if it finds a variable in the specified sequence and false otherwise.
A). TRUE
B). FALSE
View Answer
Correct: A


20. What is the output of the following code

salary = 8000

def printSalary():
  salary = 12000
  print("Salary:", salary)
  
printSalary()
print("Salary:", salary)
A). Salary: 12000 Salary: 8000
B). Salary: 8000 Salary: 12000
C). The program failed with errors
View Answer
Correct: A



 
 
 
   
   
   
UltraInfo Technologies
ITDeveloper