Confused: Newbie Function Calls

fuglyducky fuglyducky at gmail.com
Wed Aug 11 12:07:16 EDT 2010


I am a complete newbie to Python (and programming in general) and I
have no idea what I'm missing. Below is a script that I am trying to
work with and I cannot get it to work. When I call the final print
function, nothing prints. However, if I print within the individual
functions, I get the appropriate printout.

Am I missing something??? Thanks in advance!!!!

################################################
# Global variable
sample_string = ""

def gen_header(sample_string):
    HEADER = """
    mymultilinestringhere
    """

    sample_string += HEADER
    return sample_string

def gen_nia(sample_string):
    NIA = """
    anothermultilinestringhere
    """

    sample_string += NIA
    return sample_string


gen_header(sample_string)
gen_nia(sample_string)

print(sample_string)



More information about the Python-list mailing list