I am very new to Python and I'm trying to make a function so that when I call it, it assigns something to a variable. I don't know how to explain it better but this is what i got now:
again = '0'
def printa():
print(again)
def f1():
again = '1'
def f2():
again = '2'
x = input()
x = str(x)
if x == '8':
f1()
elif x == '9':
f2()
printa()
My objective is that when I write 8 the output is 1 and when I write 9 the output is 2; and right now the output is always 0. I know I could just write if x == 8 print 1
but I need to use functions