Python 3 MCQ (SET-1) – Multiple Choice Questions and Answers

  1. Which of the following version of Python was released in December, 2015 by
    Python.org?
    a. 3.3
    b. 3.5.1
    c. 2.4
    d. 2.6
  2. Python files are saved with the extension as …?
    a. .python
    b. .pe
    c. .py
    d. .pi
  3. What is the name of the GUI that comes in-built as an interactive shell with
    Python?
    a. PGUI
    b. Pyshell
    c. IDLE
    d. PythonSh
  4. IDLE stands for … ?
    a. Indigenous Development Lab
    b. Integrated Development Environment
    c. Integrated Developers Local Environment
    c. Integrated Developers Local Environment
    d. Indie Developers Environment
  5. The function to display a specified message on the screen is … ?
    a. print
    b. display
    c. run
    d. output
  6. Which of the following is an assignment operator in Python?
    a. ==
    b. ===
    c. >>>
    d. =
  7. Which of the following is used to initialize multiple variables with a common
    value?
    a. x = y: y = 33
    b. x = y = z = 33
    c. x = z; y = z; x = 33;
    d. x & y & z = 33
  8. Comments in Python begin with …?
    a. {
    b. %
    c. *
    d. #
  9. A user-specified value can be assigned to a variable with this function …
    a. user
    b. enter
    b. enter
    c. input
    d. value
  10. User input is read as …?
    a. Floating Decimal
    b. Text String
    c. Boolean Value
    d. Integer
  11. Output displayed by the print function will add this invisible character at the
    end of the line by default …
    a. \t
    b. \n
    c. \s
    d. \r
  12. Multiple values specified in parentheses to print function will display each
    value separated with this by default …
    a. Single Space
    b. Double Space
    c. A new Line
    d. Double Lines
  13. Which of the following will provide an ! character as alternative separator
    for the print function?
    a. sep is !
    b. separate = !
    c. sep >> ‘!’
    d. sep = ‘!’
  14. Which of the following will provide a * character as alternative line ending
    for the print function?
    a. end to *
    b. end as *
    c. end = ‘*’
    d. ending = ‘*’
  15. For which type of error does the interpreter halts and reports the error but
    does not execute the program?
    a. Semantic error
    b. Syntax error
    c. Runtime error
    d. All type of errors
  16. For which type of error does the interpreter runs the program but halts at
    error and reports the error as an “Exception”?
    a. Semantic error
    b. Syntax error
    c. Runtime error
    d. All type of errors
  17. For which type of error does the interpreter runs the program and does not
    report an error?
    a. Semantic error
    b. Syntax error
    c. Runtime error
    d. All type of errors
  18. What will be the output after the following statements?
    x = 6
    y = 3
    print(x / y)
    a. 2.0
    b. 2
    c. 18
    d. 18.0
  19. What will be the output after the following statements?
    x = 8
    y = 2
    print(x // y)
    a. 4.0
    b. 4
    c. 16
    d. 16.0
  20. What will be the output after the following statements?
    x = 5
    y = 4
    print(x % y)
    a. 0
    b. 20
    c. 1.0
    d. 1
  21. What will be the output after the following statements?
    x = 3
    y = 2
    x += y
    print(x)
    a. 3
    b. 2
    c. 5
    d. 1
  22. What will be the output after the following statements?
    x = 5
    y = 7
    x *= y
    print(x)
    a. 7
    b. 12
    c. 5
    d. 35
  23. What will be the output after the following statements?
    x = 25
    y = 15
    x -= y
    print(x)
    a. 10
    b. 25
    c. 15
    d. -15
  24. What will be the output after the following statements?
    x = 30
    y = 7
    x %= y
    print(x)
    a. 4
    b. 28
    c. 2
    d. 37
  25. What will be the output after the following statements?
    x = 3
    y = 7
    print(x == y)
    a. y = 7 and x = 3
    b. True
    c. x = 3 and y = 3
    d. False
  26. What will be the output after the following statements?
    x = 8
    y = 6
    print(x != y)
    a. y = 6 and x = 8
    b. True
    c. x = 6 and y = 6
    d. False
  27. What will be the output after the following statements?
    x = 83
    y = 57
    print(x > y)
    a. True
    b. False
    c. Yes
    d. No
  28. What will be the output after the following statements?
    x = 72
    y = 64
    print(x < y)
    a. True
    b. False
    c. Yes
    d. No
  29. What will be the output after the following statements?
    x = True
    y = False
    print(x and y)
    a. True
    b. False
    c. Not defined
    d. xy
  30. What will be the output after the following statements?
    x = True
    y = False
    print(x or y)
    a. True
    b. False
    c. Not defined
    d. xy
  31. What will be the output after the following statements?
    x = True
    y = False
    print(not x)
    a. True
    b. False
    c. Not defined
    d. y
  32. What will be the output after the following statements?
    x = True
    y = False
    print(not y)
    a. True
    b. False
    c. Not defined
    d. x
  33. What will be the output after the following statements?
    x = 20
    y = 40
    z = y if (y > x) else x
    print(z)
    a. True
    b. False
    c. 20
    d. 40
  34. What will be the output after the following statements?
    x = 50
    y = 10
    z = y if (y > x) else x
    print(z)
    a. True
    b. False
    c. 50
    d. 10
  35. What will be the output after the following statements?
    x = 65
    y = 53
    z = y if (x % 2 == 0) else x
    print(z)
    a. True
    b. False
    c. 65
    d. 53
  36. What will be the output after the following statements?
    x = 46
    y = 98
    z = y if (y % 2 == 0) else x
    print(z)
    a. True
    b. False
    c. 46
    d. 98
  37. What will be the output after the following statements?
    x = 2 * 4 + 7
    print(x)
    a. 30
    b. 15
    c. 22
    d. 247
  38. What will be the output after the following statements?
    x = 7 * (4 + 5)
    print(x)
    a. 63
    b. 16
    c. 33
    d. 35
  39. What will be the output after the following statements?
    x = ’24’ + ’16’
    print(x)
    a. 40
    b. 2416
    c. 21
    d. 46
  40. What will be the output after the following statements?
    x = 15 + 35
    print(x)
    a. 40
    b. 153
    c. 50
    d. 1535
  41. What will be the data type of x after the following statement if input entered
    is 18 ?
    x = input(‘Enter a number: ‘)
    a. Float
    b. String
    c. List
    d. Integer
  42. What will be the data type of y after the following statements if input entered
    is 50?
    x = input(‘Enter a number: ‘)
    y = int(x)
    a. Float
    b. String
    c. List
    d. Integer
  43. What will be the data type of y after the following statements?
    x = 71
    y = float(x)
    a. Float
    b. String
    c. List
    d. Integer
  44. What will be the data type of y after the following statements?
    x = 48
    y = str(x)
    a. Float
    b. String
    c. List
    d. Integer
  45. What will be the output after the following statements?
    x = y = z = 8
    print(y)
    a. x
    b. 8
    c. z
    d. y
  46. What will be the value of x, y and z after the following statement?
    x = y = z = 300
    a. All three will have the value of 3
    b. All three will have the value of 100
    c. All three will have the value of 300
    d. x and y will have arbitrary values, while z will have the value of 300
  47. What will be the value of x, y and z after the following statement?
    x, y, z = 3, 4, 5
    a. All three will have the value of 3
    b. All three will have the value of 345
    c. x will have the value of 3, y will have the value 4 and z will have the value of 5
    d. x and y will have arbitrary values, while z will have the value of 345
  48. What is the data type of x after the following statement?
    x = [7, 8, 9, 10]
    a. List
    b. Dictionary
    c. Tuple
    d. String
  49. What is the data type of x after the following statement?
    x = [‘Today’, ‘Tomorrow’, ‘Yesterday’]
    a. List
    b. Dictionary
    c. Tuple
    d. String
  50. What will be the output after the following statements?
    x = [‘Today’, ‘Tomorrow’, ‘Yesterday’]
    y = x[1]
    print(y)
    a. x1
    b. Today
    c. Tomorrow
    d. Yesterday
SHARE:

Leave a Comment