a) The formula that converts Celsius temperature to Fahrenheit is given below: F = 9/5*C + 32 Define a function that converts C to F degree. Then compute the Fahrenheit degrees for the following Celsius degree by using mapping. Celsius =[-40, 0, 36, 38, 40, 100] b) Create a list of 20 random grades between 0 and 100. Write the code for filtering that generates a list of grades that are A or B only (80<= grades <<100). Use filtering and lambda to create the auxiliary function. Example: [95, 19, 96, 69, 61, 72, 57, 85, 56, 75, 53, 23, 33, 94, 39, 96, 48, 49, 54, 90] Output: [95, 96, 85, 94, 96, 90]
F = 9/5*C + 32
Define a function that converts C to F degree. Then compute the Fahrenheit degrees for the following
Celsius degree by using mapping. Celsius =[-40, 0, 36, 38, 40, 100]
b) Create a list of 20 random grades between 0 and 100. Write the code for filtering that generates a list of grades that are A or B only (80<= grades <<100).
Use filtering and lambda to create the auxiliary function.
Example: [95, 19, 96, 69, 61, 72, 57, 85, 56, 75, 53, 23, 33, 94, 39, 96, 48, 49, 54, 90]
Output:
[95, 96, 85, 94, 96, 90]
c) Write the code for a reducing that creates a single string from a list of strings:
words=['Programming ', 'in ', 'Python ', 'is ', 'fun!']
Output:
'Programming in Python is fun!'
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images