Python Program to Print Number is positive or Negative. Then Check Number is Odd or Even Using Nested if Statement

Python Program to Print Number is positive or Negative. Then Check Number is Odd or Even Using Nested if Statement

 


a=int(input("Enter number:"))

if a>0:

    print(f"{a} positive number")

    if a%2==0:

        print(f"{a} is even number")

    else:

        print(f"{a} is odd number")

else:

    print(f"{a} is negative number")


Output:

Enter number:33

33 positive number

33 is odd number


टिप्पणी पोस्ट करा

0 टिप्पण्या