Python Test

This test will have no effect on your grade. Don’t even write your name on it.

  1. Write a Python for loop to print the integers (whole numbers) from 1 to 10 inclusive. Print each integer on a separate line.
  2. Given the following list of four prices,
    originalPrices = [
        5.95,
        1.99,
        0.99,
        9.95
    ]
    
    use a list comprehesion to create a new list named newPrices. The new list well contain four prices, just like the original list. Each price in the new list will be 106% of the corresponding price in the original list. In other words, the cost of everything has just gone up six percent.
  3. Given the above list of originalPrices, write a generator function containing a yield statement that will yield four new prices. Each new price will be 106% of the corresponding price in the original list.