Sail E0 Webinar

MCQs

Total Questions : 54 | Page 2 of 6 pages
Question 11. In order to store values in terms of key and value we use what Python core data type.
  1.    tuple
  2.    set
  3.    list
  4.    dictionary
 Discuss Question
Answer: Option D. -> dictionary
Question 12. Which of the following results in a SyntaxError?
  1.    “He said, ‘Yes!'”
  2.    ”’That’s okay”’
  3.    ‘”Once upon a time…”, she said.’
  4.    ‘3\’
 Discuss Question
Answer: Option D. -> ‘3\’
Question 13. What data type is the object below in Python? L = [1, 23, 'hello', 1]
  1.    dictionary
  2.    tuple
  3.    array
  4.    list
 Discuss Question
Answer: Option D. -> list
Question 14. What is the output of print 0.1 + 0.2 == 0.3 in python?
  1.    True
  2.    Error
  3.    False
  4.    Machine dependent
 Discuss Question
Answer: Option C. -> False
Question 15. What does ~4 evaluate to in python?
  1.    +3
  2.    -3
  3.    -5
  4.    -4
 Discuss Question
Answer: Option C. -> -5
Question 16. What arithmetic operators cannot be used with strings in Python?
  1.    *
  2.    +
  3.    –
  4.    All of the mentioned
 Discuss Question
Answer: Option C. ->
Question 17. To add a new element to a list we use which Python command?
  1.    list1.append(5)
  2.    list1.addLast(5)
  3.    list1.add(5)
  4.    list1.addEnd(5)
 Discuss Question
Answer: Option A. -> list1.append(5)
Question 18. What is the result of cmp(3, 1) in python?
  1.    1
  2.    True
  3.    False
  4.    0
 Discuss Question
Answer: Option A. -> 1
Question 19. To insert 5 to the third position in list1, we use which Python command?
  1.    list1.add(3, 5)
  2.    list1.insert(2, 5)
  3.    list1.insert(3, 5)
  4.    list1.append(3, 5)
 Discuss Question
Answer: Option B. -> list1.insert(2, 5)
Question 20. Say s=”hello” what will be the return value of type(s) in Python?
  1.    str
  2.    String
  3.    bool
  4.    int
 Discuss Question
Answer: Option A. -> str

Latest Videos

Latest Test Papers