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 sumsum = x + y
print("Sum is:",sum)
#Calculating divisiondiv=sum/5print("Quotient is:",div)
#Calling function
sum_div(400,5)
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments