I am teaching myself python and am writing a few scripts to better understand certain things. I was wondering why this returns 0 rather than 27. If this were java I beleive it would return 27 (I initialized a variable and later called a function that changed the variable). What is going on?
result = 0;
def cube(x):
result = x * x * x
cube(3)
print(result)