+ 1

no need for 'list()' in this 'range' situation?

I run this on my PC with Py V2.7.13 found there is no need for list() method. When 'range' is used, it products a list.

22nd Mar 2017, 3:09 AM
Jingxiong Luang
Jingxiong Luang - avatar
2 Answers
0
for list() - is a syntax error. You have to you use this: for i in range(len(list())) #or just list() depending on required result
22nd Mar 2017, 8:25 AM
Ruslan Ovcharenko
Ruslan Ovcharenko - avatar
0
The same question , i just print(range(3)) , and the input is absolutely right So why sololearn claimed that it is neccesary to call to the list when using range???? Help us please , i think it would not because language barrier , did i misunderstand?
15th Apr 2017, 2:23 PM
thĂ nh long nguyễn
thĂ nh long nguyễn - avatar