ubuntu2004
Exercise 21.1
Modify your code from Exercise 20.2 so that the function average()
returns the average of a list of numbers rather than printing it.
Exercise 21.2
Write a function that takes the following list of individual lemur species as an argument, creates a dictionary of the number of sightings of each lemur species and returns that dictionary.
Print out each species name and its number of sightings in descending order of sightings.
Hint: You wrote the code for counting lemur sightings in Exercise 17.1. Copy and paste that code then modify it.
Exercise 21.3
In Exercise 18.3 you calculated the molecular mass of the peptide "FWGCYPT".
Write a program that passes a peptide sequence to a function called peptide_mass
and return its molecular mass.
Exercise 21.4
Write a function that splits someone's full name into a forename and surname and returns both of these separately.
Hint: In Exercise 7.3 you split a string of two sentences into two separate sentences. Use the same technique here but split on a space rather than a full stop.