In teaching Informatics, the teaching of programming is important. However, in both theory and practice, the teaching of programming has been poorly presented and it's been done in a very unsystematic way. This paper looks at the teaching of programming, specifically the practice commands FOR and ways to solve the problem step by step, helping students master critical subjects such as building algorithms, writing programs, time saving and memory saving in order to teach more efficiently.