Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.
If the indentation is correct then answer is 3
a=2
if a>0:
a+=1
else:
a-=1
print(a)
If the indentation is not correct, the answer is "the code will be erroneous"
a=2
if a>0:
a+=1
else:
a-=1
print(a)
In the answer given, the indentation error is fixed, therefore the answer would be 3.
But because the else is not indented properly in the question, when you run the code it will give an error. Tried this in python itself and a compiler.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
locloc91
Highly Voted 4 years, 8 months agomplopez
Most Recent 9 months agoEllo2023
11 months, 1 week agoEllo2023
11 months, 2 weeks agovarshu_0708
11 months, 2 weeks agoivanbicalho
1 year, 2 months agonaveenbv80
1 year, 4 months agoN9
1 year, 7 months agoPremJaguar
1 year, 9 months agoJiansy90
1 year, 10 months agopalagus
1 year, 11 months ago666_m
1 year, 11 months agomacxsz
1 year, 11 months agogherulloa
1 year, 11 months agoTherizzzla
4 years, 3 months agoPygineer
4 years, 4 months agoSophieSu
4 years, 4 months ago