Mar-09-2021, 12:03 AM
(This post was last modified: Mar-09-2021, 12:03 AM by cybertron2.)
Hi everyone. I'm having trouble understanding the fundamentals of Python - namely taking one value and passing it into another function. I've been stuck on this for a few days and feel like I'm missing something incredibly basic. Any help would be greatly appreciated
def function1():
answer = int(input("type here"))
return answer
def function2(answer):
print(answer)
function1()
function2()
Put simply - it doesn't work, I don't know why it doesn't work, and I'm flailing around unsuccessfully trying to only work with the input value rather than accidentally re-launching function 1 again.
Many thanks,
Daniel
def function1():
answer = int(input("type here"))
return answer
def function2(answer):
print(answer)
function1()
function2()
Put simply - it doesn't work, I don't know why it doesn't work, and I'm flailing around unsuccessfully trying to only work with the input value rather than accidentally re-launching function 1 again.
Many thanks,
Daniel