Answer to Question #299941 in Python for Christine

Question #299941

Create a Python script that will accept three integers and will check each input number. If the input number is EVEN it will display the square of cube of the number and if the number is ODD it will display the square of the number.




Sample Output




Number 1: 5




Number 2: 8




Number 3: 3 The square of 5 is 25




The cube of 8 is 512 The square of 3 is 9.

1
Expert's answer
2022-02-19T11:24:07-0500
number = int(input('Enter number: '))
if number%2 == 0:
    print(number**3)
else:
    print(number**2)

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