[Solved] How do functions work? [closed]


What you did, you failed to call the function that is why you facing this problem.

Use this instead and you can able to get the address of a function.

In Python v2.x

#!/usr/bin/python

def get_address():
        address = raw_input("What is your address: ")   
        return address

a = get_address()
print a 

What is raw_input?

It ask the user (the optional arg of raw_input([arg])), gets input from the user and returns the data input by the user in a string.

In Python v3.x:

#!/usr/bin/python
name=input('Enter your name : ')
print ("Welcome %s, Let us be friends!" % name);

3

solved How do functions work? [closed]