Homework
Create a list that looks like this: [“ 9”, “8 7”, “0 ”, “ 2 ”].
Use map() to remove all spaces in each string (hint: replace())
Create a list of strings.
Use filter() to print a list of all palindromes (words that are the same both forward and backward)
Write a defined function addNumber that returns a lambda that adds the function parameter to the lambda input/parameter.
Ex: if your function parameter is a and your lambda parameter is b, your lambda output should be b + a
Define a variable (addFifty if a = 50, addTwo if a = 2, etc) that calls your function with a specific value for a.
Use the function variable to calculate different numbers with different values for your lambda parameter.
Hint: look at slide “def Functions with lambda” and the class code
Try if an inputted number is being divided by 0. If it is, raise an exception.
Resources:
Slides: https://docs.google.com/presentation/d/1YIsLblmj8ysy9Q4aWdZsJiuzVR6jyYUsVp0KRPaEUE0/edit?usp=sharing
Class code: https://replit.com/join/myprpmfxgv-shravyas
Contact Info:
shravyassathish@gmail.com (mentor)
kingericwu@gmail.com (TA)
felixguo41@gmail.com (TA)