Created
February 29, 2016 15:33
-
-
Save c-guzman/c4fbf9ebf438d0141cc8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# counting point mutations | |
# count all mutations where C != C, G !=G, A != A, and T != T | |
import algorithm | |
# define string variables | |
var s: string = "GAGCCTACTAACGGGAT" | |
var t: string = "CATCGTAATGACGGCCT" | |
# define count variable for number of mutations | |
var mutations: int = 0 | |
# for loop if letter of string s does not match letter of string t increase mutation variable by 1 | |
for letter in s.mitems: | |
if letter != : # I'm not sure how to iterate over the individual letters of string t here, I tried t.mitems but that didn't work. | |
mutations.inc() | |
echo mutations |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment