Exit the loop when i is 5.......find what is the error?
i=0 while i<10: if i==5: break print(i) i=i+1
#Try this i=0 while i<10: print(i) i=i+1 if i==5: break
is that a qustion or exercise ?
this is an infinti loop cuz the i will remain 0 u should write i+=1 inside the while block i=0 while i<10: if i==5: break i=i+1 print(i)
i=0 while i<10: print(i) if i==5: break i=i+1
the point of a while loop is to give a condition to where the code can get out of the loop if said condition is met. Almost no need for a break statement. Instead of seeing if it equals 5, why not set the while loop to go if 'i' is less than or equal to 5?
I have tried every way I could find but still I can't display my local images ..what am I doing wrong?
I cant understand what the problem here is. Can anyone help me out? the system in sololearn called it an error in test case 1
Izzy the iguana code coach
Hi, hope you're doing good.Could someone please tell me why does the while loop not stop when I type in rock, paper or scissors?
Finished python for beginners