mood = raw_input("Enter your mood: ").lower()
def setMood(mood):
mood = "awesome"
return mood
if mood != "awesome":
setMood(mood)
print "Yor mood is now %s!" % mood
else: print "You were awesome anyway!"
Why does this return the original input, not the one overwritten in the function? And how to get around this?
UPDATE!!!
Solution:
mood = raw_input("Enter your mood: ").lower()
def setMood(mood):
mood = "awesome"
return mood
if mood != "awesome":
mood = setMood(mood)
print "Yor mood is now %s!" % mood
else: print "You were awesome anyway!"