Sail E0 Webinar

MCQs

Total Questions : 50 | Page 1 of 5 pages
Question 1. _______Is used to create an object in python
  1.    Class
  2.    constructor
  3.    Both A & B
  4.    none​
 Discuss Question
Answer: Option B. -> constructor
Question 2. What will be the output of the following python
  1.    name
  2.    coder
  3.    throw error
  4.    none of the above
 Discuss Question
Answer: Option B. -> coder
Question 3. If you want to create an empty list called colours in Python, which of the following is correct?
  1.    colours = [ ]
  2.    colours = ( )
  3.    colours = { }
  4.    colours =
 Discuss Question
Answer: Option A. -> colours = [ ]
Question 4. What will the output be from the following code?print("Hello" + str(2) + "world!")
  1.    Hello world! Hello world!
  2.    Hello2world!
  3.    Hello Hello world! world!
  4.    SyntaxError
 Discuss Question
Answer: Option B. -> Hello2world!
Question 5. The correct way to write a variable in Python?
  1.    my_variable = 10
  2.    my variable = 10
  3.    my_variable is 10
  4.    my_variable: 10
 Discuss Question
Answer: Option A. -> my_variable = 10
Question 6. What will the output be from the following code?print(Hello world!)
  1.    Hello world!
  2.    SyntaxError
  3.    Hello world
  4.    print(Hello world!)
 Discuss Question
Answer: Option B. -> SyntaxError
Question 7. Consider this dictionary:d = {'foo': 100, 'bar': 200, 'baz': 300}What is the result of this statement:d['bar':'baz']
  1.    It raises an exception
  2.    (200, 300)
  3.    200 300
  4.    [200, 300]
 Discuss Question
Answer: Option A. -> It raises an exception
Question 8. Suppose x is defined as follows:x = [ 'a', 'b', { 'foo': 1, 'bar': { 'x' : 10, 'y' : 20, 'z' : 30 }, 'baz': 3 }, 'c', 'd']What is the expression involving x that accesses the value 30?
  1.    x[2]["bar"]["z"]
  2.    x[2]["bar"]
  3.    x["bar"]["z"]
  4.    x[2]["bar"]["z"][3]
 Discuss Question
Answer: Option A. -> x[2]["bar"]["z"]
Question 9. A location in memory used to store data that can be changed
  1.    Constant
  2.    Value
  3.    Variable
  4.    Iteration
 Discuss Question
Answer: Option C. -> Variable
Question 10. What data type would be used for storing someone's telephone numbers?
  1.    Float (using a decimal point)
  2.    Integer (just whole numbers)
  3.    String (alphanumerical data)
 Discuss Question
Answer: Option B. -> Integer (just whole numbers)

Latest Videos

Latest Test Papers