In Python, I am trying to make a variable increment in value while it is less than another number. I know that it is possible to do a
(print(x) for x in range(1, 5))
x += 1 while x < y
x = 0 y = 10 while x < y: x +=1 >>> x 10
Well you can do it in a single line because Python allows that:
x = 0 while x < y: x +=1
It is not as readable, and it doesn't conform to PEP 8, but it is doable.