def printcake():
print cake #This function prints the taste of cake when called
def setcake(taste, printq):
global cake #This makes sure that cake can be called in any function
cake = taste #sets cake's taste
if printq: #determines whether to print the taste
printcake()
setcake('good', True) #Calls the function to set cake. Tells it to print result. The output is good
ZGVmIHByaW50Y2FrZSgpOgogICAgcHJpbnQgY2FrZSAjVGhpcyBmdW5jdGlvbiBwcmludHMgdGhlIHRhc3RlIG9mIGNha2Ugd2hlbiBjYWxsZWQKZGVmIHNldGNha2UodGFzdGUsIHByaW50cSk6CiAgICBnbG9iYWwgY2FrZSAjVGhpcyBtYWtlcyBzdXJlIHRoYXQgY2FrZSBjYW4gYmUgY2FsbGVkIGluIGFueSBmdW5jdGlvbgogICAgY2FrZSA9IHRhc3RlICNzZXRzIGNha2UncyB0YXN0ZQogICAgaWYgcHJpbnRxOiAjZGV0ZXJtaW5lcyB3aGV0aGVyIHRvIHByaW50IHRoZSB0YXN0ZQogICAgICAgIHByaW50Y2FrZSgpIApzZXRjYWtlKCdnb29kJywgVHJ1ZSkgI0NhbGxzIHRoZSBmdW5jdGlvbiB0byBzZXQgY2FrZS4gVGVsbHMgaXQgdG8gcHJpbnQgcmVzdWx0LiBUaGUgb3V0cHV0IGlzIGdvb2Q=