0
how to add if statement in while loop
5 odpowiedzi
+ 1
i = 1
f = False
while i < 6 and f == False:
i += 1
print(i)
if i == 2:
f = True
+ 1
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 thanks for pointing it out. Pretty new to python so didn't know it doesn't support the "&&" and operator and the "++" addition operator.
Fixed my code.
0
i++ can also be written as i += 1