Which data type does the expression 5 > 3 evaluate to in Python?
Correct Answer: C
Explanation:
n Python, comparison expressions such as 5 > 3 evaluate to aBooleanvalue. The expression: 5 > 3 checks whether 5 is greater than 3. Since this statement is true, Python returns: True True and False are Boolean values in Python. Therefore, the correct answer isC. Boolean.
Question 2
What must be consistent within a Python code block for the code to run without syntax errors?
Correct Answer: B
Explanation:
In Python, indentation is used to group statements into a code block. A block must have a consistent indentation level so Python can correctly understand which statements belong together. For example: if True: print("Hello") print("World") Both print() statements belong to the same if block because they use the same indentation level. If indentation is inconsistent, Python can raise an IndentationError or TabError. Therefore, the correct answer isB. Indentation level.
Demo Practice Mode
You are viewing only the questions marked as Demo.