Q. What is wrong with following function code? Find reason and correct it.


def addThree (n1, n2, n3):
    return n1 + n2 + n3
    print("the answer is", n1 + n2+ n3)


Reason :-
Corrected code :-


Answer :-


Reason :- There is no error in program but if run the program print statement will not work.

Corrected code :-

def addThree (n1, n2, n3):
    return n1 + n2 + n3

#OR

def addThree (n1, n2, n3):
    print("the answer is", n1 + n2+ n3)

2 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. Hi i found your answer really help full and i hope santhi ma'am gives me marks

    ReplyDelete
    Replies
    1. Me too, Keep up the good work
      :D

      Delete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post