vals [ one solution for turning those lists into dictionary would be to zip the lists and step through them in parallel with for looplist(zip(keysvals)[('spam' )('eggs' )('toast' ) {for (kvin zip(keysvals) [kv {'eggs' 'toast' 'spam' it turns outthoughthat in python and later you can skip the for loop altogether and simply pass the zipped keys/values lists to the built-in dict constructor callkeys ['spam''eggs''toast'vals [ dict(zip(keysvals) {'eggs' 'toast' 'spam' the built-in name dict is really type name in python (you'll learn more about type namesand subclassing themin calling it achieves something like listto-dictionary conversionbut it' really an object construction request in the next we'll explore the related but richer conceptthe list comprehensionwhich builds lists in single expressionwe'll also revisit python and dictionary comprehensionsan alternative to the dict call for zipped key/value pairs{kv for (kvin zip(keysvals){'eggs' 'toast' 'spam' generating both offsets and itemsenumerate our final loop helper function is designed to support dual usage modes earlierwe discussed using range to generate the offsets of items in stringrather than the items at those offsets in some programsthoughwe need boththe item to useplus an offset as we go traditionallythis was coded with simple for loop that also kept counter of the current offsets 'spamoffset for item in sprint(item'appears at offset'offsetoffset + appears at offset appears at offset appears at offset appears at offset while and for loops