not a python pro but I guess it doesnt work because the function output is not defined when you call it at initialize. So reorder it:
Code
def output(x):
print(x)
def initialize(y):
x = 0.0
x = y
output(x)
output(y)
def main():
x = 0.0
y = 2.0
output(x)
output(y)
initialize(y)
output(x)
output(y)