Answer to Question #273927 in Python for Alice

Question #273927

Create a python code about this

Choices:

a. Calculator

b. Odd or Even

c. Positive or Negative Number Enter your choice: b Enter a number: 80 80 is an even number.


1
Expert's answer
2021-12-01T06:40:57-0500


SOLUTION CODE



print("\nChoices")
print("\na. Odd or Even")
print("b. positive or Negative")

choice = input("\nEnter your choice: ")

if choice=="a":
    number = int(input("\nEnter a number: "))
    if number % 2 == 0:
        print(str(number)+" is an even number")
    else:
        print(str(number) + " is an odd number")
elif(choice == "b"):
    number = int(input("\nEnter a number: "))
    if number == 0:
        print("The number you have entered is a zero")
    elif number > 0:
        print(str(number) + " is a positive number")
    else:
        print(str(number) + " is a negative number")
else:
    print("Invalid choice, please try again")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS