Answered step by step
Verified Expert Solution
Question
1 Approved Answer
python 3.5 Purpose: To practice using modules and simple conditionals Degree of Difficulty: Easy For this question, you'll write a program that checks whether a
python 3.5
Purpose: To practice using modules and simple conditionals Degree of Difficulty: Easy For this question, you'll write a program that checks whether a randomly generated integer is a perfect square. Recall that a perfect square is an integer for which the square 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 square, an additional 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: 961 Amazing! 961 is a perfect squareStep 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