Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 and 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 :
Here is another one.
Your random number is :
Amazing is a perfect cub
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started