0
How to use range() I forgot
I know it is for repetation . just forgot syntax
2 Respostas
+ 8
for x in range(25):
print("do something")
Kush Rawat
+ 8
Kush Rawat ,
range is a built-in function than can generate sequences of integer nunbers.
it can be used as a counter in for loops, but we can also generate a list of numbers from it.
syntax: range(start, stop, step)
keep in mind that the `stop` number argument is not included in the generated numbers.
see the python docs for more details:
https://docs.python.org/3/library/stdtypes.html#typesseq-range