Python 2.11 : Loop While

We will continue with our program add the while loop inside we will ask the user to enter an age and repeat this until he/she is validating in order to continue executing the code for that we must begin by comment all the code here it is necessary to know that there are several types of loop we have the loop while and the loop for and here we are going to learn the loop while, the loop while in French means as long as as we have seen above when declaring the variable we initialize it directly so if I know how to make a equal to zero I create a variable of type int which is initialized to zero and if I make now an a equal to 1 I reaffect a new value to a in the same way if I make an a equal to plus 1 well I will make the print each time and you will see the difference print a I execute my code you see here a = 1 after a= 2 after a =3 so this is how it works we do the reassignment of the values after the declaration I will comment on this code it tries the first a = 0 instead. and we will continue our code if I do a while loop I do while a less than 10 this condition will always be a will always be inferior to 10 here in good we write print value of a colon I'm going to do STR to convert to a string and if I put a and here I'm going to put an a if I leave it like that it will be a repeated loop an infinite loop that will stop when I click on all right I'm going to run so that you you see that it continues to run until I put stop here that the program stops so to compensate for this we will add this at this level and here I say that a after having done the print the new value of a we reassign a new value to a and so on I run my code and you will see at this level we have a A0 A1 A2 A3 until 9 because we said a must be less than 10 well I'm going to write at this level here I'm going to do a print start of the loop and I will put end I restart my code we have the beginning of the loop and we have the end and so on the loop how you say it runs at the beginning of the loop we have the value and then we have the end of the loop that's how it works so I'll delete or comment this We will continue with our program add the while loop inside we will ask the user to enter an age and repeat this until he/she is validating in order to continue executing the code for that we must begin by comment all the code here it is necessary to know that there are several types of loop we have the loop while and the loop for and here we are going to learn the loop while, the loop while in French means as long as as we have seen above when declaring the variable we initialize it directly so if I know how to make a equal to zero I create a variable of type int which is initialized to zero and if I make now an a equal to 1 I reaffect a new value to a in the same way if I make an a equal to plus 1 well I will make the print each time and you will see the difference print a I execute my code you see here a = 1 after a= 2 after a =3 so this is how it works we do the reassignment of the values after the declaration I will comment on this code it tries the first a = 0 instead. and we will continue our code if I do a while loop I do while a less than 10 this condition will always be a will always be inferior to 10 here in good we write print value of a colon I'm going to do STR to convert to a string and if I put a and here I'm going to put an a if I leave it like that it will be a repeated loop an infinite loop that will stop when I click on all right I'm going to run so that you you see that it continues to run until I put stop here that the program stops so to compensate for this we will add this at this level and here I say that a after having done the print the new value of a we reassign a new value to a and so on I run my code and you will see at this level we have a A0 A1 A2 A3 until 9 because we said a must be less than 10 well I'm going to write at this level here I'm going to do a print start of the loop and I will put end I restart my code we have the beginning of the loop and we have the end and so on the loop how you say it runs at the beginning of the loop we have the value and then we have the end of the loop that's how it works so I'll delete or comment this