Imagine that you have a list of matching percentages,
matches = [0.6, 0.8, 0.94, 0.2, 0.4], write code to create a new listgood_matcheswhich only includes matches better than0.7.The previous list didn’t include the name of the sample that the match was associated with. Now imagine that the list consists of both sample names and their match percentiles. Write code to return a new list
good_samplesthat includes the sample names only where the match is better than0.7. Here is an example input list:
sample_matches = [
['SAM1', 0.6],
['SAM2', 0.8],
['SAM3', 0.94],
['SAM4', 0.2],
['SAM5', 0.4]
]Write a function
find_good_matchesthat takes a match threshold (e.g.0.7) and a list like the one presented asgood_matchesand returns a list of tuples where each tuple contains the sample name and the percentage match for samples over match threshold.Write a function
sum_it(a, b)that takes two numbers,aandband returns the result of adding them together. Then write a functionprint_sum(a, b)that takes two numbers,aandband prints the result of adding the two numbers together. What is the difference between these two functions? Which one returns a value?Write a function
double_itthat takes a list of numbers and doubles each of them in place.What effect does the
double_itfunction have on the original list that you pass as a parameter to thedouble_itfunction? What is this effect called?Write a function
double_it2that takes a list of numbers and returns a new list of the numbers, doubled. Woulddouble_it2work with a tuple of numbers? Woulddouble_itwork with a tuple? Why?