SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Tony Gaddis
Chapter:
Simple Functions
Exercise:
Algorithm Workbench
Question:5 | ISBN:9780132576376 | Edition: 2

Question

Look at the following function definition:

def my_function(a, b, c):

      d = (a + c) / b

      print(d)

a. Write a statement that calls this function and uses keyword arguments to pass 2 into a , 4 into b , and 6 into c .

b. What value will be displayed when the function call executes?

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

 

def my_function(a, b, c):
      d = (a + c) / b
      print(d)

my_function(2, 4, 6)

 

a. A statement that calls this function with keyword arguments is as follws

    my_function(2, 4, 6)

b. The value will be displayed when the function call executes is 2.0

  

0 0

Discussions

Post the discussion to improve the above solution.