Computers and Technology

Have you ever used an owner’s manual to figure out how to operate something that you had just purchased? Well, Python has an owner’s manual. It’s called The Python Standard Library. This is sometimes referred to as “Python documentation.” It’s a great resource because it tells you everything you could ever want or need to know about Python. (This also makes it a little intimidating!)

In this lab, you are going to use the Python Standard Library to find and use a function in the math module.

Just like the random module and the time module that we have used, the math module is a set of functions that you can import into your code so that you can—you guessed it!—code some math functions more easily.

For example, the square root of a number is the answer to this question: What can I multiply by itself to get a certain number? For example, if you want to know the square root of 25, you are asking, “What number do I multiply by itself to get 25?” The answer to that is 5, since 5 x 5 equals 25.

Being able to find the square root can be very helpful. Imagine that you have 25 one-foot-long square floor tiles and you want to know how much of the floor they can cover. The answer is 5 square feet! Or, imagine that you are excitedly planning on moving into your college dorm room when you find out that it is 100 square feet. That might sound big…until you determine the square root and notice that you have a 10 x 10-foot room…which is not so big after all!

You can click on this link to access the page of the documentation that contains the math module: https://docs. python. org/3/library/math. html

For this lab, you will write a program that has this output if the user enters 100 and 72:

Here is some pseudocode to help you write your program:

Import the math module
Ask the user for the first number
Ask the user for the second number
Print the square root of the first number
Print the square root of the second number
To write this program, you will search the math module page to find the function that you need. For most browsers, if you press the CTRL + F, a box will pop up that will let you search on that page. This will allow you to find the function that you seek quickly.

When your program is working properly, take a screenshot of it to turn in. If you cannot get your code to work properly, turn in the screenshot along with a paragraph that explains what you did to try to fix it.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 00:10, makailaaa2
My has been slow anyone else’s ?
Answers: 1
image
Computers and Technology, 23.06.2019 19:30, alangonsales6232
2. fluorine and chlorine molecules are blamed fora trapping the sun's energyob forming acid rainoc producing smogod destroying ozone molecules
Answers: 2
image
Computers and Technology, 23.06.2019 19:50, Aprillove7939
Which feature is selected to practice and save the timing of a presentation
Answers: 1
image
Computers and Technology, 24.06.2019 00:00, Amrinderkhattra
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
Do you know the correct answer?
Have you ever used an owner’s manual to figure out how to operate something that you had just purcha...

Questions in other subjects: