Library

--Originally published at Hackerman's house

A library is a built-in module that can be used to solve several problems. Once python is installed it includes a series of standard libraries such as math that can be used to solve mathematical problemas or generally just to work better with numbers. There is also the time library to count the time. You can find more information about it here.

https://docs.python.org/3/library/

In this example we’ll be importing the “math” librarie to calcule the area of a circle, the radius will be given by the user and the program will substitute this number in a formula

Import a librarie is simple, the syntax is this:

import name_of_the_library

And the functions included in every library are different, these functions can be find in the link above.

The functions of math that we’ll be using is the pi value.

libraries

The “try” and “except” are used to determine if the input given by the user is a number. The radius is given by the user and the area has a simple formula PI times radius square. That is why we needed the math module.

Here is how the program works.

libraries2

Thanks for reading me.

giphy-5