Functions in PythonSimple Python Function
You can Run the Python Code below. (First Delete all existing code then type your own code)

[withcode id=”3C” mode=”embed” width=”400px” height=”600px”]

Answers the following

  1. What are actual and formal parameters in python function?
  2. What are fruitful and non-fruitful functions in python ?
  3. What are void and non-void functions in python ?
  4. Function in python returns multiple values or return more than one value . True /False.
  5. Write a function cube takes parameter c and returns cube of c. In calling pass x as parameter and value of x is entered by user using input function.
  6. Write above function without return type (void type) also.
  7. See the code given below and answers the three questions asked in the last

def number(x):

    x=x+5

    print(x)

def digit(y):

    y=y+5.5

    return y

a=20

b=10

number(b)

print(digit(a))

number(a)

print(digit(b))

  1. Actual parameters and formal parameters in above code
  2. Identify the non-void (fruitful) function and void (non-fruitful) functions from above code
  3. What is the output after running above python code.

Watch My videos(full playlist of functions part wise ) for more understanding click below.

4 thoughts on “Functions in Python”

Leave a Reply

Your email address will not be published. Required fields are marked *