Question: write a python function 2. [8 points) For this question, assume 1st is a list of numbers, weight is a number, special_nums is a set
2. [8 points) For this question, assume 1st is a list of numbers, weight is a number, special_nums is a set of numbers, and names is a dictionary from numbers to strings. Each part of this question is looking for one line of code showing how to accomplish a simple operation. Some of these can also be done in more complicated ways - we are only looking for the simple, one-line solution. (a) (2 points) print True/False if weight is a key in names (b) (2 points) print the last number in 1st (c) (2 points) print the string associated with weight in names (a) (2 points) print True/False if weight is in special_nums 2. [8 points for this question, assume 1st is a list of numbers, weight is a number, special_nums is a set of numbers, and names is a dictionary from numbers to strings. Each part of this question is looking for one line of code showing how to accomplish a simple operation. Some of these can also be done in more complicated ways - we are only looking for the simple, one-line solution. (a) (2 points) print True/False if weight is a key in names (b) (2 points print the last number in 1st (c) (2 points) print the string associated with weight in names (a) (2 points print True/False if weight is in special_nums
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
