Basic Ops

--Originally published at angelmendozas

During the weekend I learned several stuff and one of them was to make basic operation on python and they are done like this

Captura de pantalla 2016-08-22 a las 10.15.56 a.m.

This is a very clear example: You put your variables as a, b c or d, depending on how many you want.

Then I introduced some comments to specify which operation was going to be written.

For a sum we know it’s +, subtraction -, multiplication *, exponent **, division / , and for the remainder of a division we use %.

The results are these:

Captura de pantalla 2016-08-22 a las 10.29.36 a.m.

For the first division which is the first zero just put: float and you variable in parenthesis like this:

float(c) / a

and it should give you the decimals which are 0.190327…etc. Because if you just put the division then Python will give you the most basic answer, no decimals, just everything that goes before the dot.