How many functions can another function call? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

How many functions can another function call?

Say that I have 4 functions and another function, but that one function acts as an initializer where basically, the work of that function is to keep the program running by calling those 4 functions. Is there a limit to the number of functions I can call in one function? Is it a common practice to do that? For example: def one(): pass def two(): pass def three(): pass def four(): pass def start(): one() two() three() four() start()

31st Aug 2021, 9:41 AM
Alex
Alex - avatar
4 ответов
+ 3
No there is no limit You can call multiple functions from one function👍
31st Aug 2021, 9:54 AM
Vtec Fan
Vtec Fan - avatar
+ 3
Yeah man, that's functional programming for ya. And not really a limit, but at some point, you'd want to make that one shorter! so you break it into a few seperate functions with all your added functions, then just call the few you made.
31st Aug 2021, 9:54 AM
Slick
Slick - avatar
+ 1
Not exactly, but just take a look at this code. Forget all the nonsense at the top and look at the bottom at the method process_invoice() with all the other method calls. It's just a way to make the code easier to understand and change because you dont have to rewrite everything, you can change a specific thing your program does, while minimizing code written https://code.sololearn.com/c3WuqNK0IlqP/?ref=app
31st Aug 2021, 5:33 PM
Slick
Slick - avatar
0
I see, so it's something like, my start() function will only call four() and inside four() function, it calls three() and so on.
31st Aug 2021, 5:27 PM
Alex
Alex - avatar