Python how is this wrong


def spam():
spam_variable = True

def eggs():
eggs_variable = False

print spam_variable
print eggs_variable

and then it prints true and false like its supposed to, but then I receive an error that says spam should have the value of True so what am I doing wrong here?

As far as i know i was only supposed to assign values. which i did at first and it wouldn't go through. i did add the define then the print, a function, another spam value line, and then another print. no matter how many different ways i do it the same message keeps coming up, "spam needs to be assigned a value of true" and it printed out true several times and even a function but nothing changes

please don't judge my grammer :blush:


Hi @trzer0 ,

For Exercise 7: A Matter of Interpretation, you do not need to use functions. Instead, just create a variable named spam and assign it the value, True, then create a variable named eggs, and assign it the value, False.

To assign True to spam, you only need to do this ...

spam = True

Now, try the eggs part.