Variables save within the program, but it I exit the program and reenter it, all the variables reset. Can I prevent this?
No, because that’s what variables are. However, you can store data (and keep it after the game is closed) by using the “storage” actions.