# # ps2pr6.py - Problem Set 2, Problem 6 # # list comprehensions # # Problem 6-1: LC puzzles! # This code won't work until you complete the list comprehensions! # If you can't figure out how to complete one of them, please # comment out the corresponding lines by putting a # at the start # of the appropriate lines. # part a lc1 = [ for x in range(5)] print(lc1) # part b words = ['hello', 'world', 'how', 'goes', 'it?'] lc2 = [ for w in words] print(lc2) # part c lc3 = [ for word in ['hello', 'bye', 'no']] print(lc3) # part d lc4 = [ for x in range(1, 10) if ] print(lc4) # part e lc5 = [ for c in 'bu be you'] print(lc5) # Problem 5-2: Put your definition of the powers_of() function below. # Problem 5-3: Put your definition of the shorter_than() function below.