def my_diet(event, style):
if event == 1:
choice = raw_input("""What type of animal are you?
A) Carnivore
B) Herbivore
C) Omnivore
""")
if choice == "A":
style = "Carnivore"
print style
elif choice == "B":
style = "Herbivore"
elif choice == "C":
style = "Omnivore"
else:
style = "not-sure-yet"
print style
else:
pass
return style
print style
eating_style = None
my_diet(1, eating_style)
print eating_style
What was printed on the console was: (assuming choice
= "A")
Carnivore
Carnivore
None
Does this mean that eating_style
is immutable? If so, how should I change the function to assign a different value to eating_style
?