Using While Loops and Incrementing Exercise Problem
Hello, the exercize attached the aforementioned was to create a while loops that produced odd numbers under 30. In my solution to the aforementioned exercise I wrote:
x = 0
while x <30:
print(x)
1 answers ( 0 marked as helpful)
Hi Alan!
Thanks for reaching out.
Please, use the following code:
x = 0
while x < 30:
if x % 2 != 0:
print(x, end=' ')
x += 1
Hope this helps.
Best,
Tsvetelin