Problem 1: Write a class NameSet
that collects a unique set of names. Within the class, names should be stored in a list. NameSet
should accept names in any format (upper case, lower case, etc.), but keep them capitalized.
Hint - when solving this question, these string functions may be useful: upper()
, lower()
, and capitalize()
.
# Your code goes here.
Problem 2: Write a class CountNuc
that stores the counts of A's, C's, G's, and T's in a DNA sequence. Your class should be able to accept both upper and lower case DNA sequences. Nucleotide counts in CountNuc
should be stored in a dictionary. Once your class has been written, confirm your class operates correctly on a test string "AGct". After that, determine the counts of A's, C's, G's, and T's in dna_string
string given below, and print the counts.
# Your code goes here.
# Variable to check your class on
dna_string = "ATCGAGCTataCCGATACAGGcTGGTATAAAAgatTC"