CLASS XI PYTHON BASIC MCQ QUESTIONS

Basic Python MCQs:



  1. What is the correct extension of a Python file?

    • a) .pyth
    • b) .pt
    • c) .py
    • d) .pyt
    • Answer: c) .py
  2. Which of the following is a valid variable name in Python?

    • a) 2variable
    • b) variable-name
    • c) variable_name
    • d) variable.name
    • Answer: c) variable_name
  3. What is the output of the following code?

    python
    print(3 + 4 * 2)
    • a) 14
    • b) 11
    • c) 10
    • d) 7
    • Answer: b) 11
  4. Which of the following is NOT a valid Python data type?

    • a) int
    • b) float
    • c) double
    • d) str
    • Answer: c) double
  5. What will the following code output?

    python
    print(type(10))
    • a) <class 'str'>
    • b) <class 'int'>
    • c) <class 'float'>
    • d) <class 'bool'>
    • Answer: b) <class 'int'>
  6. Which of the following functions is used to get user input in Python?

    • a) input()
    • b) get()
    • c) scan()
    • d) read()
    • Answer: a) input()
  7. Which of the following is the correct way to write a comment in Python?

    • a) // This is a comment
    • b) # This is a comment
    • c) /* This is a comment */
    • d) <!-- This is a comment -->
    • Answer: b) # This is a comment
  8. What will the following code return?

    python
    print(10 // 3)
    • a) 3.33
    • b) 3
    • c) 3.0
    • d) 4
    • Answer: b) 3
  9. Which of the following is used to define a block of code in Python?

    • a) Curly brackets { }
    • b) Parentheses ( )
    • c) Indentation
    • d) Quotation marks
    • Answer: c) Indentation
  10. What will the following code output?

    python
    x = "Hello" y = "World" print(x + y)
    • a) HelloWorld
    • b) Hello World
    • c) Hello+World
    • d) Error
    • Answer: a) HelloWorld

More Basic Python MCQs:

  1. Which of the following is the correct syntax to create a function in Python?

    • a) function myFunction():
    • b) def myFunction():
    • c) create myFunction():
    • d) func myFunction():
    • Answer: b) def myFunction():
  2. What will the following code output?

    python
    print(type([1, 2, 3]))
    • a) <class 'list'>
    • b) < class 'tuple'>
    • c) <class 'set'>
    • d) <class 'dict'>
    • Answer: a) <class 'list'>
  3. Which of the following operators is used for exponentiation in Python?

    • a) ^
    • b) %
    • c) **
    • d) *
    • Answer: c) **
  4. What is the output of the following code?

    python
    print(5 % 2)
    • a) 2
    • b) 1
    • c) 0
    • d) 5
    • Answer: b) 1
  5. Which of the following is NOT a keyword in Python?

    • a) def
    • b) for
    • c) print
    • d) while
    • Answer: c) print
  6. How can you create a list in Python?

    • a) list = {1, 2, 3}
    • b) list = (1, 2, 3)
    • c) list = [1, 2, 3]
    • d) list = <1, 2, 3>
    • Answer: c) list = [1, 2, 3]
  7. What will the following code output?

    python
    x = [1, 2, 3, 4] print(len(x))
    • a) 4
    • b) 5
    • c) 3
    • d) 2
    • Answer: a) 4
  8. What does the len() function do in Python?

    • a) Counts the number of characters in a string
    • b) Returns the length of an object
    • c) Counts the number of items in a list
    • d) All of the above
    • Answer: d) All of the above
  9. Which of the following is the correct way to declare a tuple in Python?

    • a) tuple = [1, 2, 3]
    • b) tuple = (1, 2, 3)
    • c) tuple = {1, 2, 3}
    • d) tuple = <1, 2, 3>
    • Answer: b) tuple = (1, 2, 3)
  10. What is the output of the following code?

    python
    print("apple" == "Apple")
    • a) True
    • b) False
    • c) Error
    • d) None
    • Answer: b) False

Arithmetic Operators MCQs:

  1. Which of the following is NOT an arithmetic operator in Python?

    • a) +
    • b) *
    • c) **
    • d) and
    • Answer: d) and
  2. What will the following code output?

    python
    print(10 + 5)
    • a) 5
    • b) 15
    • c) 50
    • d) 105
    • Answer: b) 15
  3. Which operator is used for division in Python?

    • a) //
    • b) %
    • c) /
    • d) **
    • Answer: c) /
  4. What will the following code output?

    python
    print(9 % 2)
    • a) 4
    • b) 1
    • c) 0
    • d) 9
    • Answer: b) 1
  5. Which of the following operators performs exponentiation in Python?

    • a) **
    • b) ^
    • c) *
    • d) %
    • Answer: a) **
  6. What is the result of the following expression?

    python
    print(5 * 3 - 2)
    • a) 11
    • b) 15
    • c) 13
    • d) 17
    • Answer: c) 13
  7. Which of the following operations is performed by the // operator?

    • a) Normal division
    • b) Floating-point division
    • c) Floor division
    • d) Exponentiation
    • Answer: c) Floor division
  8. What will be the result of the following code?

    python
    print(10 // 3)
    • a) 3.33
    • b) 3
    • c) 4
    • d) 0
    • Answer: b) 3
  9. Which operator is used for calculating the remainder in Python?

    • a) /
    • b) %
    • c) //
    • d) **
    • Answer: b) %

Additional Arithmetic Operators MCQs:

  1. What will the following code output?

    python
    print(10 - 4 / 2)
    • a) 3
    • b) 8
    • c) 5
    • d) 12
    • Answer: b) 8
  2. Which of the following expressions is evaluated first in Python?

    python
    print(5 * (2 + 3) ** 2)
    • a) 2 + 3
    • b) 5 * 2
    • c) (2 + 3) ** 2
    • d) All are evaluated simultaneously
    • Answer: a) 2 + 3
  3. What will the following code output?

    python
    print(100 // 3)
    • a) 33
    • b) 33.33
    • c) 34
    • d) 0
    • Answer: a) 33
  4. Which operator would you use to perform integer division in Python?

    • a) /
    • b) //
    • c) %
    • d) **
    • Answer: b) //
  5. What will the following code output?

    python
    print(5 * 3 % 4)
    • a) 1
    • b) 15
    • c) 3
    • d) 4
    • Answer: a) 1
  6. What is the result of the following operation?

    python
    print(25 % 7)
    • a) 3
    • b) 4
    • c) 5
    • d) 6
    • Answer: b) 4
  7. Which of the following will result in a floating-point value?

    • a) 10 + 5
    • b) 10 / 5
    • c) 10 // 5
    • d) 10 % 5
    • Answer: b) 10 / 5
  8. What will the following code output?

    python
    print(2 ** 3 * 2)
    • a) 8
    • b) 16
    • c) 32
    • d) 64
    • Answer: b) 16
  9. What is the output of the following code?

    python
    print(4 + 3 * 2 ** 2)
    • a) 28
    • b) 16
    • c) 19
    • d) 25
    • Answer: c) 19
  10. Which of the following operations has the highest precedence?

    • a) Addition +
    • b) Multiplication *
    • c) Exponentiation **
    • d) Modulus %
    • Answer: c) Exponentiation **
  11. What will be the result of the following operation?

    python
    print(15 // 2 * 2)
    • a) 15
    • b) 14
    • c) 16
    • d) 7
    • Answer: b) 14
  12. What will the following code output?

    python
    print(-10 % 3)
    • a) 2
    • b) -1
    • c) 1
    • d) 0
    • Answer: a) 2
  13. What is the result of this operation?

    python
    print(3 * (2 + 4) / 2)
    • a) 8
    • b) 6
    • c) 9
    • d) 12
    • Answer: c) 9
  14. What will the following code output?

    python
    print(25 // 4 % 3)
    • a) 2
    • b) 1
    • c) 0
    • d) 4
    • Answer: b) 1
  15. Which of the following operations evaluates to True?

    python
    print(10 == 2 * 5)
    • a) False
    • b) Error
    • c) True
    • d) None of the above
    • Answer: c) True
  16. Which of the following operations results in an integer?

    • a) 5 / 2
    • b) 5.0 // 2
    • c) 5 // 2
    • d) 5 ** 2
    • Answer: c) 5 // 2
  17. What will the following code output?

    python
    print(5 + 10 // 3)
    • a) 3
    • b) 8
    • c) 8.33
    • d) 8.0
    • Answer: b) 8
  18. Which of the following is the correct output of the following expression?

    python
    print(20 / 3 * 2)
    • a) 13.33
    • b) 6.67
    • c) 20
    • d) 40
    • Answer: a) 13.33
  19. What is the result of the following code?

    python
    print(10 % 3 * 2 + 1)
    • a) 7
    • b) 5
    • c) 3
    • d) 1
    • Answer: a) 7
  20. Which of the following expressions evaluates to False?

    python
    print(15 != 3 * 5)
    • a) True
    • b) False
    • c) Error
    • d) None of the above
    • Answer: b) False

Post a Comment

0 Comments