Skip to content

Fixing the value of a variable that changes in terms of another

Suppose I have a global variable time that is incremented by 1 unit with every update of the window according to some FPS (for example in Pygame). Then suppose I have another variable defined in terms of time, like this: The behavior I want is that the variable final stores the value of t just when the functi…