Question: PYTHON LANGUAGE! Simple code please #1 #2 #3 #4 Given a string named DNA and a second string named valid, build a dictionary named counts
PYTHON LANGUAGE! Simple code please
#1
#2
#3
#4
Given a string named DNA and a second string named valid, build a dictionary named counts that contains the counts of all characters in DNA that are present in valid. For example, if DNA is a name for "ACGTU" and valid is a name for "ACGT", then counts would refer to a dictionary {'A':1, 'C':1, 'G':1, 'T':1} Given a dictionary named grades, built with key:value pairs of student:score, build a list named score90 of student names who scored 90 or above. For example: if grades referred to {"David":50, "Justin":90, "Samuel": 91}, then you would build a list named score90 that refers to ["Justin", "Samuel"] Given a dictionary named grades, built with key:value pairs of student:score, calculate average Score, the average of all scores. For example: if grades referred to {"David":50, "Justin":90, "Samuel": 91}, then average Score would refer to 77.0. In case grades happens to be empty, average Score should ha ve a value of None. Given a list of data named data where each subsequent item in the list is smaller than the preceding item, compute smallestPosition as the integer posi tion in the list that has a value closest to 0.0. As an example, if the data refers to [1000.2, 100.1, 10.0, 1.0, -1.1, -10.2], smallestPosition would be assig ned 3. if data is empty, smallestPosition should refer to None. If two positions hold items that are equally close to 0.0, smallestPosition should refer to the lower position number. This can be done using a for loop and iterating over the entire list. It can also be done using a while loop, taking advantage of the order of the data in the I ist (binary search)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
