Introduction to Python
50 MCQ Questions (Class 9 – CBSE AI)
Q1. Which function is used to take input from the user in Python?
a) get()
b) input()
c) read()
d) scan()
Q2. Which function is used to display output in Python?
a) show()
b) display()
c) print()
d) output()
Q3. What is the correct extension of a Python file?
a) .pt
b) .pyt
c) .py
d) .python
Q4. Which of the following is a valid variable name?
a) 2value
b) value-1
c) value_1
d) value 1
Q5. Which symbol is used for assignment in Python?
a) ==
b) =
c) :=
d) =>
Q6. What will be the output of: print(5 + 3)?
a) 53
b) 8
c) Error
d) 5+3
Q7. Which data type is used to store whole numbers?
a) float
b) str
c) int
d) bool
Q8. Which data type is used to store decimal values?
a) int
b) float
c) char
d) bool
Q9. What is the data type of: name = "Python"?
a) int
b) float
c) str
d) bool
Q10. Which of the following is a Boolean value?
a) 0
b) 1
c) True
d) "True"
Q11. Which operator is used for multiplication?
a) x
b) *
c) %
d) /
Q12. Which operator gives remainder?
a) /
b) //
c) %
d) **
Q13. What does // operator do?
a) Division
b) Modulus
c) Floor division
d) Power
Q14. What is the output of: print(10 // 3)?
a) 3.33
b) 3
c) 4
d) Error
Q15. Which operator is used for power?
a) ^
b) **
c) //
d) %
Q16. What is the output of: print(2 ** 3)?
a) 6
b) 8
c) 9
d) 23
Q17. Which statement is used for decision making?
a) loop
b) print
c) if
d) input
Q18. Which keyword is used when the condition is false?
a) if
b) elif
c) else
d) for
Q19. Which symbol is used for equality check?
a) =
b) !=
c) ==
d) >=
Q20. What is the output of:
Copy code
Python
if 5 > 3:
print("Yes")
a) No output
b) Error
c) Yes
d) False
Q21. Which operator checks greater than?
a) <
b) <=
c) >
d) ==
Q22. Which operator checks not equal?
a) ==
b) =
c) !=
d) >=
Q23. What is the output of: print(type(10))?
a) int
b) <class 'int'>
c) number
d) integer
Q24. What is the output of: print(type(3.5))?
a) int
b) float
c) <class 'float'>
d) decimal
Q25. Which function converts value into integer?
a) str()
b) float()
c) int()
d) bool()
Q26. Which function converts value into string?
a) char()
b) string()
c) str()
d) text()
Q27. What is the output of: print("Hello" + "World")?
a) Hello World
b) HelloWorld
c) Error
d) Hello+World
Q28. Which of the following is an arithmetic operator?
a) and
b) or
c) +
d) not
Q29. Which statement is true about Python?
a) Case insensitive
b) Case sensitive
c) No variables
d) No data types
Q30. What is indentation used for in Python?
a) Decoration
b) Comments
c) Block of code
d) Output
Q31. Which of the following causes an error?
a) print("Hi")
b) Print("Hi")
c) print(5)
d) print(3+2)
Q32. Which symbol is used for comments?
a) //
b) /* */
c) #
d)
Q33. What is the output of: print(10 > 20)?
a) True
b) False
c) 10
d) Error
Q34. What does elif stand for?
a) Else if
b) End if
c) Else loop
d) Extra if
Q35. How many conditions can be checked using elif?
a) Only one
b) Two
c) Many
d) None
Q36. What is the output of: print(bool(0))?
a) True
b) False
c) 0
d) Error
Q37. Which value is considered False in Python?
a) 1
b) -1
c) 0
d) 10
Q38. Which statement is correct?
a) Python uses {}
b) Python uses indentation
c) Python uses semicolon
d) Python uses brackets only
Q39. What is the output of: print(5 == 5)?
a) False
b) True
c) Error
d) None
Q40. Which of the following is a relational operator?
a) +
b) %
c) >=
d) *
Q41. Which statement executes when if condition is false?
a) if
b) elif
c) else
d) print
Q42. What is the output of: print("5")?
a) 5
b) "5"
c) Error
d) String 5
Q43. Which function finds the data type?
a) type()
b) datatype()
c) class()
d) id()
Q44. Which keyword is used to start a condition?
a) when
b) check
c) if
d) case
Q45. Which of the following is NOT a data type?
a) int
b) float
c) str
d) real
Q46. What will be the output of: print(6 % 2)?
a) 0
b) 2
c) 3
d) Error
Q47. Which operator is used for division?
a) %
b) //
c) /
d) **
Q48. Which statement is correct?
a) input() returns int
b) input() returns string
c) input() returns float
d) input() returns bool
Q49. What is the output of: print(3 + 2 * 2)?
a) 10
b) 7
c) 8
d) 12
Q50. Which of the following is compulsory in Python if statement?
a) Semicolon
b) Indentation
c) Brackets
d) Quotes