while loop equivalent of for loop the for loop is similar to the while loopbut when you only need to iterate over items in listusing for loop is much less code to type this is while loop that acts the same as the previous for loop by adding extra codeiterableval ['cats''pasta''programming''spam'index while (index len(iterableval))thing iterableval[indexprint(' really like thingindex index really like cats really like pasta really like programming really like spam but using the for statement automatically does this extra code and makes programming easier since you have less to type the rest of the displayboard(function displays the missed letters and creates the string of the secret word with all the not yet guessed letters as blanks print('missed letters:'end='for letter in missedlettersprint(letterend='print(the for loop on line will iterate over each character in the missedletters string and print them on the screen remember that the end=will replace the newline character that is printed after the string with single space character for exampleif missedletters was 'ajtwthis for loop would display