+ 2
Range function output
https://code.sololearn.com/chG2URafoBYP/?ref=app is range output is list? if yes why it gives me this error
4 Respostas
+ 3
In Python before version 3, range() return a list, and xrange() return an iterator...
In Python since version 3, range() return an iterator, and xrange() does no more exist...
Obviously, code playground use Python 3 ^^
+ 1
Better use list comprehention:
x = [i for i in range (101)]
0
Thanks Jan Markus
0
x=list(range(0,101))
x.append(3)
print(x)