Please i would like some help in checking if my source code


Python programming

Please I would like some help in checking if my source code for is susceptible to short-circuit evaluation.I don't need answers, I just need corrections. The source code is to check the integer parts of the both numbers to see if they are even or odd, and prints exactly one of the following messages on the screen:

The decimal part of the both numbers is odd. or

The decimal part of the both numbers is even. or

The decimal part of the number a is even, but the decimal part of the number b is odd. or

The decimal part of the number a is odd, but the decimal part of the number b is even.

Source code:

#Part2 - odd & even number

enter3 = print("Please enter two numbers: ")

enter4 = int(float(input("Enter number 1: ")))

enter5 = int(float(input("Enter number 2: ")))

if (enter4%2 == 0) and (enter5%2 == 0):

  print("The decimal part of both numbers is even.")

elif (enter4%2 != 0) and (enter5%2 != 0):

  print("The decimal part of both numbers is odd.")

elif (enter4%2 == 0) and (enter5%2 != 0):

  print("The decimal part of the number a is even, but the decimal part of the number b is odd.")

else:

  print("The decimal part of the number a is odd, but the decimal part of the number b is even.")

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Please i would like some help in checking if my source code
Reference No:- TGS02922813

Now Priced at $20 (50% Discount)

Recommended (91%)

Rated (4.3/5)