Skip to main content
Updated the range limit
Source Link
Santi
  • 4.5k
  • 4
  • 26
  • 28

List comprehensions are exactly made for that:

smaller_list = [x for x in range(10000100001) if x % 10 == 0]

You can get more info about them in the python official documentation: http://docs.python.org/tutorial/datastructures.html#list-comprehensions

List comprehensions are exactly made for that:

smaller_list = [x for x in range(10000) if x % 10 == 0]

You can get more info about them in the python official documentation: http://docs.python.org/tutorial/datastructures.html#list-comprehensions

List comprehensions are exactly made for that:

smaller_list = [x for x in range(100001) if x % 10 == 0]

You can get more info about them in the python official documentation: http://docs.python.org/tutorial/datastructures.html#list-comprehensions

Source Link
Santi
  • 4.5k
  • 4
  • 26
  • 28

List comprehensions are exactly made for that:

smaller_list = [x for x in range(10000) if x % 10 == 0]

You can get more info about them in the python official documentation: http://docs.python.org/tutorial/datastructures.html#list-comprehensions