WP that reads in any number and prints the following: a) The number itself. b) The square of the number. c) The cube of the number. 2- WP to reverse the digit order of the 4-digit number you entered? 3- WP to read two integers and compare them if they are equal or not using an if statement.
Added by Salvador G.
Step 1
WP that reads in any number and prints the following: - To read in any number, we can use the input() function in Python. - To print the number itself, we can simply use the variable that stores the input. - To print the square of the number, we can use the ** Show more…
Show all steps
Your feedback will help us improve your experience
Danielle Ashley and 91 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a program that would read 3 1-digit numbers, say x, y, and z, and would output the following: x * y < z if x * y is less than z x * y = z if x * y is equal to z x * y > z if x * y is greater than z Ex. if the inputs are 5, 6, 9, the output is 5 * 6 > 9
Christian O.
(Split digits) Write a program that prompts the user to enter a four-digit integer and displays the number in reverse order. Here is a sample run: Enter an integer: 3125 3 1 2 5
(Reverse number) Write a program that prompts the user to enter a four-digit integer and displays the number in reverse order. Here is a sample run: Enter an integer: 3125 / - Enter The reversed number is 5213
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD