· 9 years ago · Oct 24, 2016, 09:26 AM
1# CMSC11 Lab Exercise 11 – Lists
2
3Create the following functions. Don’t forget the design recipe! I’ll be looking for the following:
4
5- Signature, purpose, stub
6- Examples
7- Template
8
9---
10
111. Create a function `bump_up` that accepts a list of grades and returns the list with 20% added to each grade
12
13
141. Create a function `cold` that accepts a list of temperatures in Celsius and returns only those below 20 degrees
15
161. Create a function `gmail_only` that accepts a list of email addresses and
17 returns a list of only those addresses that end with "@gmail.com"
18
191. Create a function `long_names` that, given a list of names, returns a list of all names longer than 8 characters
20
211. Create a function `can_afford`, that Prof. Cheapskate can use to determine which items to buy at the University Bookstore. He will only buy individual items that are less than 100 pesos. But because he's a Professor, he gets a 5% discount for all items at the bookstore. `can_afford` should take a list of prices (before discount), and produce a list of prices that he can afford with the discount applied.