Question: Part 1 : For the following problems you will be working with either vectors ( lists ) , or matrices ( lists of lists )

Part 1: For the following problems you will be working with either vectors (lists), or matrices
(lists of lists). For each question, you should write a lambda function that does what the question
asks. Unless otherwise specified, you may not call other functions within your lambda expression.
There is no need to validate the input, you can assume the adequate data type will be provided.
1.(1 pt) Write the lambda function vector_plus_one that takes in a list as a parameter and
returns a new list with every element increased by one.
>>> vector_plus_one([1,2,3])
[2,3,4]
2.(1 pt) Write the lambda function collatz_steps that takes in a list as a parameter, and
returns a new list that has removed any non-integers and integers less than 1, and replaces
every positive integer left number with a step in the hailstone formulas. As a reminder:
If a number is odd, it becomes 3* n +1
If a number is even, it becomes n //2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!