Answer to Question #202093 in Python for freika

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

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS