So I am not sure if this can be done at all, but was curious anyway. Let us suppose I have the following piece of code:
def statement1():
# Do something
def statement2():
# Do something
def statement3():
# Do something
statement1()
statement2()
statement3()
Now, as you can see here, I have to execute all the above functions one after the other. They are also named in a similar fashion, so that made me wonder- is there a way to loop over function calls? I basically want to have something like a for loop which loops over 'statements', and I don't end up calling each one again and again with only a slight modification in the name.
A side note- I am new to the community so feel free to give me feedback on how to ask and comment on the answers, would go a long way in helping me.
Thanks in advance!