Yes, a flag is just a variable that usually, but not always, has one of two values to say whether something is happening or not (usually True or False, or 1 or 0).
Although I've not checked your code myself, it sounds like the animation for your jumping character is getting reset while the spacebar is being held down. This is why you need a flag to stop the animation being reset if the character is already jumping.
Although I've not checked your code myself, it sounds like the animation for your jumping character is getting reset while the spacebar is being held down. This is why you need a flag to stop the animation being reset if the character is already jumping.