Revised the wording and fixed the grammar (#23607)

This commit is contained in:
JawnsenTrain
2018-10-29 17:44:03 -05:00
committed by Randell Dawson
parent df32b90b1f
commit 1602caddc9

View File

@ -55,12 +55,12 @@ print(result)
#### Line by Line explanation of the above code #### Line by Line explanation of the above code
1. First of all a variable 'result' is assigned to an empty string. 1. First, a variable 'result' is assigned to an empty string.
2. For loop is being used to iterate over a list of numbers. 2. For loop is being used to iterate over a list of numbers.
3. This list of numbers is generated using the range function. 3. This list of numbers is generated using the range function.
4. so range(1,11) is going to generate a list of numbers from 1 to 10. 4. So range(1,11) is going to generate a list of numbers from 1 to 10.
5. On each for loop iteration this 'i' variable is going to take up values from 1 to 10. 5. On each for loop iteration, the 'i' variable is going to take up values from 1 to 10.
6. On first iteration when the variable i=1,then the variable [result=result+str(i)+"(space character)"],str(i) converts the 'i' which is an integer value to a string value. 6. On first iteration when the variable i=1, then the variable [result=result+str(i)+"(space character)"],str(i) converts the 'i' which is an integer value to a string value.
7. Since i=1, on the first iteration finally result=1. 7. Since i=1, on the first iteration finally result=1.
8. And the same process goes on until i=10 and finally after the last iteration result=1 2 3 4 5 6 7 8 9 10. 8. And the same process goes on until i=10 and finally after the last iteration result=1 2 3 4 5 6 7 8 9 10.
9. Therefore when we finally print the result after the for loop the output on the console is '1 2 3 4 5 6 7 8 9 10'. 9. Therefore when we finally print the result after the for loop the output on the console is '1 2 3 4 5 6 7 8 9 10'.