The article describes a study carried out on pupils aged 12-13 with no prior programming experience. The study examined how they learn to use loops with a fixed number of repetitions. Pupils were given a set of programming tasks to solve, without any preparatory or accompanying instruction or explanation, in a block-based visual programming environment. Pupils’ programs were analyzed to identify possible misconceptions and factors influencing them. Four misconceptions involving comprehension of the loop concept and repeat command were detected. Some of these misconceptions were found to have an impact on a pupil’s need to ask the computer to check the correctness of his/her program. Some of the changes made to tasks had an impact on the frequency of these misconceptions and could be the factors influencing them. Teachers and course book writers will be able to use the results of our research to create an appropriate curriculum. This will enable pupils to acquire and subsequently deal with misconceptions that could prevent the correct understanding of created concepts.