I am currently writing a program that is required to be as fast as possible.
Currently, one of the functions looks like this:
def function():
    value = get_value()
    # Multiple lines of code
    if value == "1":
        print("success")
I want to know, if there is a way of calling the get_value() function at the start of the function and instantly running the multiple lines of code and then whenever the the get_value() function is finishes and returns a value the value variable is updated ready for the if statement.
Thanks!
 
    