Before you attempt this activity, it is best that you review lecture video one from week eight. You can find the video and slides on the module page.
For this activity you will be using the integrated development environment recommended by the module leader. If you need to set up your development environment, it is recommended that you check out the instructions from activity four of week one.
Are You Struggling?
If you have trouble with any of the tasks or want to check your answers are correct, then please make yourself known to a member of staff.
For this task, you are expected to create a lambda function that will add \(20\) to the argument \(a\) and print the result.
Secondly, you are also expected to create a lambda function that will provide the exponentiation of argument \(x\) with argument \(y\) and print the result.
An example of the output would be similar to this:
x (5) + 20: 25
x (3) ** y (3): 27
For this task, you are expected to create a lambda function that will sort a list of tuples. For this task, you need to sort the following list of tuples:
[('4063CEM', 75),('4061CEM', 88), ('4059CEM', 94), ('4064CEM', 40)]
The sorted list of tuples should be like this:
[('4059CEM', 94), ('4061CEM', 88), ('4063CEM', 75), ('4064CEM', 40)]
For this task, you are expected to create a lambda function that will square and cube each number ('\(x\)') that is in a list of integers. For this task, you can use the following list of integers:
[1, 2, 3, 4, 5, 6, 7, 8,9, 10]
The returned data type from the lambda function is expected to be a list.