# wsq05

--Originally published at Tomas Enciso

This one almost Identical to a past wsq except for this one functions took care of everything. The program grabs 2 numbers that the user inputs, of course they have to be integers, and each functions either sums, subtracts, multiplies, divides, or shows the remainder of those 2 numbers.

In this example I used 5 and 7, in the code you may have noticed that there is a while and a print statement, this just so the user doesn’t enter 0 second because then there would be an error when trying to divide a number with 0.

# WSQ-05

--Originally published at Program

You will go back and do WSQ01 – Fun with Numbers again.

But this time, write a function for each calculation. Each function should define two parameters (in this example of type int) and return the correct value as an integer as well.

You main program needs to ask the user for the input and then call each function to calculate the answer for each of the parts.

if you wanna see an easier way go here:

https://chinbrow.wordpress.com/2017/01/30/calculator/

# # WSQ 05 – On To Functions

--Originally published at マルコ

## What to Do

You will go back and do WSQ01 – Fun with Numbers again.

But this time, write a function for each calculation. Each function should define two parameters (in this example of type int) and return the correct value as an integer as well.You will go back and do WSQ01 – Fun with Numbers again.

You main program needs to ask the user for the input and then call each function to calculate the answer for each of the parts.

Featured image:

http://www.pixiv.net/member_illust.php?mode=medium&illust_id=34076723

# Functions in Python

--Originally published at Programming

In this post we will:

¡Recycle!

##### Gif from: http://giphy.com/gifs/helpsgood-2FazaqYizLltuIIE0

But not as the usual way. We will use the programm we made in this post: Fun with numbers. We will do the same, but now with functions. First look how it runs:

It’s the same you already saw before. But now look at the code:

Let’s explain how it works.

The first part as you see, is just declare functions. Thats why you write def and after the name and the variables in brackets. We need it give us the operation, that why we write return and the operation to perform, that we already describe in the post Fun with numbers. The inputs will be the same way, and the thing that changes is the math operations. We are using functions, so we don’t need to perfom it like the traditional way. We just call the function and finally we print it

# WSQ-05

--Originally published at Site Title

Para realizar este programa volvemos a WSQ-01 y debemos desarrollar una proto-calculadora pero que esta vez opere con funciones.

Para realizarlo, simplemente definimos cada función. Una función debe sumar, la otra restar, la otra, multiplicar, etc. Una vez que las funciones están operativas, las insertamos en el programa principal y este se ejecuta. En vez de realizar las operaciones, tomará las operaciones que vienen en cada función.