Answer the question
In order to leave comments, you need to log in
How to pass data from one function to another?
I can't figure out how to pass data from one function to another.
If I have the following structure:
-общая папка
- папка с функциями
-функция1.ру
-функция2.ру
-основной файл.ру
def func ():
a = input()
def func2 ():
c=a*2
Answer the question
In order to leave comments, you need to log in
To pass data from a function, use the return statement
. For example:
def func():
return input('введи число:')
def func2(a):
return a * 2
def func3(z):
return int(z) * 2
print(func2(func()))
print(func3(func()))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question