- 2

Print i as long as i is less than 6.

i = 1 i < 6 print(i) i += 1

28th Apr 2022, 8:36 AM
sreenu apple
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.
28th Apr 2022, 10:33 AM
Ervis Meta
Ervis Meta - avatar
0
This is how I got it: i = 1 while i < 6: print(i) i += 1
24th Aug 2022, 2:04 PM
Kaitlyn Weatherall
Kaitlyn Weatherall - avatar