I am learning python and am currently writing a simple program that has to be divided into functions. My problem is that I have one function that should return strings for four different variables, that then should be used in another function.
E.g.
def function1():
var1 = input("Write something: ")
var2 = input("Write something: ")
var3 = input("Write something: ")
def function2():
print(var1)
print(var2)
print(var3)
function1()
function2()
This gives an error message since var1 is not defined in the frame of function2. How should this be solved? The illustration is very simplified for clarity, but I could post something more specific if required.