Using the while loop?


So I'm trying to learn how to write code in Python to be able to print from 0 to 50 counting by 5 using a while loop. Any ideas?


while x <= 50:
     print x
     x += 5

something like this would do, but isn't it better to use a for loop?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.