<jupyter_start><jupyter_text>Quiz 0102   Use a lambda function and map() to answer the following questions. 1). Add 1 to each element of the list 'a' and create another list. a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]<jupyter_code>def new(number):
    a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    n = len(a)
    answer= []
    for i in range(n):
        lambda i : i - number
        answer.append(i)
    return answer
print(new(1))<jupyter_output>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]<jupyter_text>2). Multiply element-wise the lists 'a' and 'b'. Show the result as another list.a = [2, 4, 6, 8, 10]b = [10, 8, 6, 4, 2]  Use a lambda function and filter() to answer the following questions. 3). Find the multiples of 5 in the range 1~100. Show the result as a list.<jupyter_code>answer= []
for i in range(1,101):
    if  lambda i: i%5 == 0:
        answer.append(i)
print(answer)<jupyter_output><empty_output><jupyter_text>4). In the following list, find the values larger than 160. Show the result as a list.a = [145.2, 160.3, 155.2, 171.6, 165.34, 167.2, 161.1, 164.9]<jupyter_code>a = [145.2, 160.3, 155.2, 171.6, 165.34, 167.2, 161.1, 164.9]
new_List =[]
length = len(a)
for i in range(length):
     if lambda i : a < 165:
        new_List.append(a)
print(new_List)<jupyter_output><empty_output><jupyter_text>5). In the following list, find the values larger than 160 and smaller than 165. Show the result as a list.a = [145.2, 160.3, 155.2, 171.6, 165.34, 167.2, 161.1, 164.9]<jupyter_code>a = [145.2, 160.3, 155.2, 171.6, 165.34, 167.2, 161.1, 164.9]
new_List =[]
length = len(a)
for i in range(length):
     if lambda i : a < 165:
        new_List.append(a)
print(new_List)<jupyter_output><empty_output><jupyter_text>6). In the following list of names, extract only those stargin with 'J'. Show the result as a list.a = ['Sara', 'Jack', 'Rebecca', 'Jennifer', 'Paul', 'Andrew', 'John']<jupyter_code>a = ['Sara', 'Jack', 'Rebecca', 'Jennifer', 'Paul', 'Andrew', 'John']
n = len(a)
count=0
for i in range(n):
    if a[i] == 'J':
        count +=1
        print("J found")
        a.remove('J')
    print(a)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup