Basics of Python – Multiple Choice Questions (MCQs)
-
-
14. Which of the following is an immutable data type in Python?
-
15. What is the output of `print(2 ** 3)`?
-
16. Which operator is used for exponentiation in Python?
-
17. What is the output of `print('Python'[1:4])`?
-
18. Which function is used to find the length of a string or list in Python?
-
19. What is the output of `print(3 == 3.0)`?
-
20. Which keyword is used for conditional execution (if statement) in Python?
-
21. Which keyword is used for the 'else if' condition in Python?
-
22. Which keyword is used for the 'else' condition in Python?
-
23. What is the output of the following code? `x = 5; if x > 3: print('Yes') else: print('No')`?
-
24. What is the output of the following code? `x = 2; if x > 3: print('A') elif x == 2: print('B') else: print('C')`?