0

While and If statement

In python, is it possible to write an if-statement inside a while loop? If yes, how can I do that?

28th Mar 2017, 4:55 PM
Sean Chen
Sean Chen - avatar
2 Answers
+ 8
while True: i += 1 if i == 8: break print(i)
28th Mar 2017, 5:02 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
0
Wow thanks!!
28th Mar 2017, 5:04 PM
Sean Chen
Sean Chen - avatar