Question #202093

  1. Give an example of defining and calling functions.
  2. Create a function that prints the sum of two numbers and divides the sum by 5. The result should be float.

Expert's answer



#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)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS