Python - Videos and Questions

33 / 78

In Python a function is some reusable code that may takes arguments(s) as input, do some computation, and then may return a result or results.


Note - Having trouble with the assessment engine? Follow the steps listed here


No hints are availble for this assesment

Answer is not availble for this assesment

Please login to comment

6 Comments

Hello CloudxLab team,

Can you please provide an example to understand how a function may return multiple results ?

  Upvote    Share

Hi,

Below is a function that return multiple values:

def func(): 
    str = "geeksforgeeks"
    x = 10
    return str, x;

Thanks.

  Upvote    Share

ok..thank you ..i executed your above code , but I have only called func () in the code below  & not done any print , so can you please let me know why it still shows output ?

  Upvote    Share

Hi,

This is because of the return statement.

Thanks.

  Upvote    Share

Function does not necessary return a value. so statement should be false.

  Upvote    Share

Hi Usha,

You are right! We have changed the question, would request you to try once again.

Thanks.

-- Rajtilak Bhattacharjee

  Upvote    Share