# Write list comprehensions, dictionary comprehensions or generators as # necessary to produce the following outputs: # A list of all odd integers between 0 and 100 # Some examples from reddit: https://www.reddit.com/r/learnpython/comments/4d2yl7/i_need_list_comprehension_exercises_to_drill/ # Find all integers between 1-1000 that contain a 3. What about the first 1000 # integers with that property that are greater than 35? # Replace all occurences of 'a' with '!' in the following string (but don't use # a library function. Yes I know str.replace exists. "Conditional expressions can be used in all kinds of situations where you want to choose between two expression values based on some condition. This does the same as the ternary operator ?: that exists in other languages." # List all the words in the obove string that contain more than 5 letters # Count the number of occurences of each letter in the above string. The output # should be a dictionary with the letter as the key, and the number of occurences # as the value. I am actually not sure this is a good example. # The square root of 2 is 1.41, in base 10 the second decimal place as a value # of 1. What are the first 10 such integers? Hint: itertool.count() is a # generator that will yield all non negative integers. # The first 10 lines of a file that do not start with a '#' character. (After # you implement some of the things in this file, you could use this file). # Create an iterable that contains all members of the fibonaci sequence. # Implement the 'range' generator. # Create an iterable that contains the moving average over the fibonacci # sequence.