#HackTheVirus: Counting point mutations
In this last task, you will be counting point mutations. You have to write a code that counts how many nucleotides differ between two DNA sequences of equal length.
Given two strings of equal length representing two DNA sequences, you have to write a function that counts how many point mutations there are, identified by a different nucleotide symbol in one of the sequences. For example:
seq1 = ‘AAACCCTGT’
seq2 = ‘AGACCCTGA’
count_point_mutations(seq1, seq2) → Output: 2
The input consists of two strings of equal length representing the DNA sequences. The output is an integer representing the total number of point mutations between the two sequences.
Ready? Implement your function below:
Got it? Check your code to get the password:
To check if your code solves correctly the problem, follow these steps in the interactive console:
- Copy your code above for the definition of count_point_mutations(seq1, seq2) function in the console (you may need to do this line by line). Important: Copy the whole function definition: def count_point_mutations(seq1, seq2): …
- Call check.check(count_point_mutations) in the console and press ENTER.
- If your code gives the correct answer, you will retrieve the password to complete the challenge!