What change should I make in this python code so that I'll be able to output all Even numbers less than 1000 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What change should I make in this python code so that I'll be able to output all Even numbers less than 1000

https://code.sololearn.com/cDc6Am5rfauX/?ref=app

26th Sep 2021, 4:14 AM
bernard
bernard - avatar
1 Answer
+ 1
bernard Nothing wrong with your code, but if you are looking for alternate methods, then here are 2 others. print([i for i in range(0,1000,2)]) print() [print(i) for i in range(0,1000,2)]
26th Sep 2021, 5:25 AM
Rik Wittkopp
Rik Wittkopp - avatar