shortened the name of the variable from num to and the result variable to output_ ints so it would still fit on one line other than thisall that' different between this example and the previous one is the if len( part this extra code excludes any strings with more than two characters the if statement is applied before the int functionso it' testing the length of string since our input strings are all integers at heartit excludes any number over now that is all there is to list comprehensionswe use them to map input values to output valuesapplying filter along the way to include or exclude any values that meet specific condition any iterable can be the input to list comprehensionanything we can wrap in for loop can also be placed inside comprehension for exampletext files are iterableeach call to __next__ on the file' iterator will return one line of the file we could load tab delimited file where the first line is header row into dictionary using the zip functionimport sys filename sys argv[ with open(filenameas fileheader file readline(strip(split('\ 'contacts dictzip(headerline strip(split('\ ')for line in file for contact in contactsprint("email{email-{last}{first}format**contact)this timei've added some whitespace to make it somewhat more readable (list comprehensions don' have to fit on one linethis example creates list of dictionaries from the zipped header and split lines for each line in the file erwhatdon' worry if that code or explanation doesn' make senseit' bit confusing one list comprehension is doing pile of work hereand the code is hard to understandreadand ultimatelymaintain this example shows that list comprehensions aren' always the best solutionmost programmers would agree that for loop would be more readable than this version