Creation and use of ranges in Python

– Creation and use of ranges in Python                                                           @PablO_CVi

Loops can be created with while(You can see here how to make loops with while) and for making loops with ranges, the loop has to  be with for, the next steps must be followed, first write for, then the variable this loop is applying like x, after this goes in range, and in parenthesis the number it will stop, and it will start from 0 (8), another option is to separate with a comma the number you want to start and the number you want it to stop, (0,-8), the last way of using the range is first the numer it is going to start, then separated with a comma the number it is going to end, and sepparated from another comma the number of numbers it will count per time. For example: for i in range (1,sz+1):).

Here is my code: https://github.com/PablOCVi/Mastery/blob/master/Mastery25.py

 

 

 

CC BY 4.0 Creation and use of ranges in Python by Pablo is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.