PYTHON
1. Which symbol is used for comments in Python?
A. //
B. #
C. /*
D. <!-- -->
Answer: B
2. Which function displays output in Python?
A. input()
B. display()
C. print()
D. output()
Answer: C
3. What data type is "Hello"?
A. Integer
B. Boolean
C. String
D. Float
Answer: C
4. Which operator is used for exponentiation?
A. ^
B. **
C. //
D. %%
Answer: B
5. What is the output of 5 // 2?
A. 2.5
B. 3
C. 2
D. 1
Answer: C
6. Which keyword defines a function?
A. func
B. define
C. function
D. def
Answer: D
7. Which collection is mutable?
A. Tuple
B. String
C. List
D. Integer
Answer: C
, 8. What does len() do?
A. Adds values
B. Counts items
C. Removes items
D. Converts type
Answer: B
9. Which loop repeats while a condition is true?
A. for
B. loop
C. repeat
D. while
Answer: D
10. Which statement stops a loop immediately?
A. stop
B. break
C. continue
D. pass
Answer: B
11. What is the result of 3 + 2 * 2?
A. 10
B. 7
C. 8
D. 12
Answer: B
12. Which function gets user input?
A. print()
B. get()
C. input()
D. read()
Answer: C
13. Which data structure uses key-value pairs?
A. List
B. Tuple
C. Dictionary
D. Set
Answer: C
14. What is the output of type(5)?
A. int
B. str
C. float
D. bool
Answer: A
15. Which operator checks equality?
A. =
B. ==
C. !=