Question: vTo practice using modules and simple conditionals For this question, you ll write a program that checks whether a randomly generated integer is a perfect

vTo practice using modules and simple conditionals
For this question, youll write a program that checks whether a randomly generated integer is a perfect
cube. A perfect cube is an integer for which the cube root is also an integer.
First, your program should import both the random and math modules. Make sure to use the import syntax
as shown in the course readings.
Then, your program should generate a random number between 1 and 10000(inclusive).
Finally, your program should display that number to the console. If the number is a perfect cube, an addi-
tional message should be displayed to say so. Use a conditional statement along with any functions from
the math module that you think you need to do this.
Sample Run
Here is a possible sample run (output value of a variable is shown in blue text):
Your random number is : 5062
Here is another one.
Your random number is : 125
Amazing !125 is a perfect cub

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!