How to use range() I forgot | Sololearn: Learn to code for FREE!
0

How to use range() I forgot

I know it is for repetation . just forgot syntax

13th Jun 2024, 4:47 AM
Kush Rawat
Kush Rawat - avatar
2 odpowiedzi
+ 8
for x in range(25): print("do something") Kush Rawat
13th Jun 2024, 4:51 AM
BroFar
BroFar - avatar
+ 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
13th Jun 2024, 6:28 PM
Lothar
Lothar - avatar