Mastery22

Repetitions

While: Is used for repeating sections of code until a defined condition is met.

For: Is used when you have a piece of code which you want to repeat n number of times. 

Recursion: Is when a function is called inside de same function.

It depends on what your program is about. While is used for repeting actions. For is used for actions that the function have to do for each element in something. And recursion is when you have some conditions that are going to change the original value and then it have to make the function again.

 

Link: https://github.com/LizethAcosta/Tareas/blob/master/Mastery22

22

 

CC BY 4.0 Mastery22 by Thais Lizeth Santos Acosta is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.