the range(function is often used in for loopswhich are much like the while loops you've already seen for loops the for loop is useful for looping over list of values this is different from the while loopwhich loops as long as certain condition is true for statement begins with the for keywordfollowed by new variable namefollowed by the in keywordfollowed by an iterable valueand ending with colon an iterable is value of the listrangeor string data types there are also other data types that are considered iterables which will be introduced later each time the program execution iterates through the loop the new variable in the for statement is assigned the value of the next item in the list for in range( )print(' is set to str( ) is set to is set to is set to is set to is set to the range object returned by range( is equivalent to the list [ in for statement the first time the execution goes through the code in the for-blockthe variable will be set to on the next iterationi will be set to and so on the for statement automatically converts the range object returned by range(into listso there' no need for list(range( )in the for statement just use range( lists and strings are also iterable data types you can use them in for statements try entering the following into the interactive shellfor thing in ['cats''pasta''programming''spam']print(' really like thingi really like cats really like pasta really like programming really like spam for in 'hello'print(ipost questions to