In this post, you will learn how to make lists directly, and to combine it with for and ranges.
First, a list in pyton is a group of elements, it could be anything, they are separated by a comma:
x = [1,2345.34,name,”hello”, “..-´{{+}”]
They are normally stored on a token, in that case, x
Ranges are a pattern of number usually stated by an including start, an excluding end, and the steps.
range (1,11,1)
So that means from 1 to 11 each 2,
another direct way to put a range is
range (11)
that means from exactly the same
The parametres must be integers, they cannot be floats or text, they could be variables if the variable is storing an integer.
Here is an example:
The ranges and lists: Masteries 23, 25 by charliegdrummer is licensed under a Creative Commons Attribution 4.0 International License.