increment to the "steps" argument of the list [not that, not that, THIS ONE] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

increment to the "steps" argument of the list [not that, not that, THIS ONE]

i want to creat a list that goes exponent without a loop by giving the the argument described above (title) increment (its like c++ or any other number but its not working on phyton) the result should look like this for ex: name = list(range[2, 16, 2++] print name [2, 4, 8, 14] is it possible??

13th Sep 2016, 12:51 AM
David
David - avatar
2 Answers
0
impossible
19th Sep 2016, 4:44 PM
Wai Hlyan Htun
Wai Hlyan Htun - avatar
0
I don't think that Python has an inbuilt way of doing this, however you could always define a function that returns the list you want
5th Nov 2016, 10:09 AM
brasspots
brasspots - avatar