πŸ“Š Python
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
πŸ’¬ Discuss
βœ… Correct Answer: (C) Both A and B

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
293
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
85%
Success Rate