Identify the output of the following Python statements.
b = 1
for a in range (1, 10, 2):
b += a + 2
print (b)
Answers
Answered by
4
The IndentationError is expected an indented block.
This is the most common type of error in python language.
Very small indentation can stop the flow of program.
Explanation:
- This is because in python language whenever the use of any condition is done specially the If and the else condition block than the proper indentation needs to be done.
- Hence, after the for loop in the given program one space needs to be given so that the answer becomes 36.
- Therefore in the Python programming language one has to be very careful with spaces.
Similar questions