Give an example of defining and calling functions.
Create a function that prints the sum of two numbers and divides the sum by 5. The result should be float.
1
Expert's answer
2021-06-02T07:49:42-0400
#Defining function
def sum_div(x,y):
#calculating and printing sum
sum = x + y
print("Sum is:",sum)
#Calculating division
div=sum/5
print("Quotient is:",div)
#Calling function
sum_div(400,5)
Comments
Leave a comment