I work with the financial exchange API. I need to perform three actions 1) Once to make an action, a purchase 2) Get data about this action 3) Work with this data on a cycle, once a minute, for an hour
I would like to do this with two functions.
def action(): my_action = ... my_data = .... return my_data def info(data): for _ in range (60): my_info = data * 2 print (my_info) info(data=action()) In principle, it works, the action is performed once, and info - many times, but this record looks somehow not logical, and if you add more variables, then everything can become complicated. There are more correct, logical methods for my task.