#LOOP WHILE in PYTHON #loops are needed to perform repetition in the program #Python supports two types of loops: WHILE and FOR #Write a program that prints hello 5 times i=0 while(i < 5): print("hello") i=i+1 print("i after loop", i) #while loop condition is True, repeat statements #inside the loop (loop body) #tracing the program #i=0 #i<5 0<5 True hello will be printed and i=i+1, i =0+1=1, i gets value 1 #condition will be checked again i< 5 1<5 True hello will be printed, i=i+1=1+1=2 #condition will be checked again i< 5 2<5 True hello will be printed, i=i+1=2+1=3 #condition will be checked again i< 5 3<5 True hello will be printed, i=i+1=3+1=4 #condition will be checked again i< 5 4<5 True hello will be printed, i=i+1=4+1=5 #condition will be checked again i< 5 5<5 False LOOP IS TERMINATED #iterations #i - loop index, iterator #each execution of the loop body statements is called - iteration #This loop performed 5 iterations