0
def info(name, address):

    name = (input ("Please Enter Your Name : "))
    address = (input ("Please Enter Your Address : "))


    return name
    return address



def userinfo():

    sumom=info(name='', address='')

    print("Thank you for coming Mr. "+sumom)
userinfo()

Hello Folks! problem is here only "name" is printing but not "address" on userinfo() function, Can someone please help me out?

  • Multiple return points in your function will not both be executed. When your function hits the first return point `return name` the method will return and execution of the method's body will be complete. To return both items, try something similar to: `def names(first, last): return (first, last)` – S. Whittaker Oct 31 '17 at 11:33
  • Done, Thanks...@SeanWhittaker – Taimoor Oct 31 '17 at 13:23

1 Answers1

0

After return statement the program leaves function, so your second return is not executed.

Laszlowaty
  • 1,295
  • 2
  • 11
  • 19