example we can use while loop to mimic for loopas shown below both loops have the exact same effect for in range( )print(ii= while < print(ii= + remember that the for loop starts with the loop variable equal to and ends with it equal to to use while loop to mimic the for loopwe have to manually create our own loop variable we start by setting it to in the while loop we have the same print statement as in the for loopbut we have another statementi= + to manually increase the loop variablesomething that the for loop does automatically example below is our old friend that converts from fahrenheit to celsius temp eval(input'enter temperature in celsius')print'in fahrenheitthat is ' / *temp+ program that gets input from user may want to check to see that the user has entered valid data the smallest possible temperature is absolute zero- the program below takes absolute zero into accounttemp eval(input'enter temperature in celsius')if temp<- print'that temperature is not possible ')elseprint'in fahrenheitthat is ' / *temp+ one way to improve this is to allow the user to keep reentering the temperature until they enter valid one you may have experienced something similar using an online form to enter phone number or credit card number if you enter an invalid numberyou are told to reenter it in the code belowthe while loop acts very similarly to the if statement in the previous example temp eval(input'enter temperature in celsius')while temp<- temp eval(input'impossible enter valid temperature')print'in fahrenheitthat is ' / *temp+ note that we do not need an else statement herelike we had with the if statement the condition on the while loop guarantees that we will only get to the print statement once the user enters valid temperature until that pointthe program will be stuck in the loopcontinually asking the user for new temperature example as mentioned beforeit is valuable skill is to be able to read code one way to do so is to pretend to be the python interpreter and go through the code line by line let' try it with the