In this Article I’ll show you diverse functions to calculate in Python.
The first thing you can see is that the user has to define A & B with an „input„. Before that you can see „int„, it stands for integer. So the user is only allowed to put in whole numbers without decimal place. It’s also shown as a comment behind those lines. Comments are easily done by putting a „#“ infront of your comment.
I think that the next three functions explain themselves. The fourth one (line 16 in the picture) is an integer based divison. It means the result of this devision shows only the first figure, without the decimal numbers. It’s done by a double „//„.
With the last function (line 19) „divmod“ you can do an integer based divison and it shows you the remainder of that division. These two function show you the result: „print(result)“ & „print(result)„. First one shows you the result of the integer based divison, the second one shows you the remainder of that divison. Because I did the integer based divison already I only used the „print(result)“
That it is how it looks like when you run it:
Thanks for reading my Blog!