This page tought me everything I needed to know about functions for this WSQ.

This is my code:

def sum(num1, num2):
    return(num1 + num2) 

def diff(num1, num2):
    return(num1 - num2) 

def prod(num1, num2):
    return(num1 * num2)

def div(num1, num2):
    return(num1 // num2)

def rem(num1, num2):
    return(num1 % num2) 

x = int( input( "Give me a number! "))
y = int( input( "Give me another number! ")) 


print("The sum of both numbers is", sum(x,y)) 

print("The difference of both numbers is", diff(x,y)) 

print("The product of both numbers is", prod(x,y)) 

print("The integer based division of both numbers gives", div(x,y)) 

print("The remainder of integer division is", rem(x,y))

CC BY 4.0 WSQ08 – On To Functions by finntec is licensed under a Creative Commons Attribution 4.0 International License.