I have a function which has an if statement and asks for user input.
def my_function():
answer = input(";")
if condition 1
a = 1
else
a = 0
I then want to run the function like so ''' my_funnction() ''' Then I want to extract the value of a based on the outcome of the function. When I try to do this it says the variable is undefined. When I define the variable, a, outside the function then its value doesn't change. How can I have the value of my variable be extracted from the function?