- 2
Print i as long as i is less than 6.
i = 1 i < 6 print(i) i += 1
2 Answers
0
First of all, what lamguage is that, it seems like python but be more specific.
Second, you are doing something (print(i)) checking a condition (i less than 6)
So you shoud use while loop like:
i = 1
while i<6:
print(i)
i = i+1
Third, your code example has indentation errors and so is invalid.
0
This is how I got it:
i = 1
while i < 6:
print(i)
i += 1