A

Admin • 828.03K Points
Coach

Q. Consider the following code segment and identify what will be the output of given Python code?

Code:
a = int(input("Enter an integer: "))
b = int(input("Enter an integer: "))

if a <= 0:
b = b +1
else:
a = a + 1
  • (A) if inputted number is a negative integer then b = b +1
  • (B) if inputted number is a positive integer then a = a +1
  • (C) Both A and B
  • (D) None of the mentioned above
  • Correct Answer - Option(C)
  • Views: 7
  • Filed under category Python
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.