From c7334b3440936295eb5e00d3a97cee03f60d6b69 Mon Sep 17 00:00:00 2001 From: cruggles Date: Wed, 3 Oct 2018 23:00:51 -0500 Subject: [PATCH 1/2] add mutations function in python --- mutations.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 mutations.py diff --git a/mutations.py b/mutations.py new file mode 100644 index 0000000..c399e43 --- /dev/null +++ b/mutations.py @@ -0,0 +1,7 @@ +def mutations(words): + for l in words[1]: + try: + "".lower().index(l) + except ValueError: + return False + return True \ No newline at end of file From 104eda31c08500f9f4dc3f580d840252b679c110 Mon Sep 17 00:00:00 2001 From: cruggles Date: Sat, 6 Oct 2018 13:03:14 -0500 Subject: [PATCH 2/2] fix function --- mutations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mutations.py b/mutations.py index c399e43..fe98a9c 100644 --- a/mutations.py +++ b/mutations.py @@ -1,7 +1,7 @@ def mutations(words): - for l in words[1]: + for l in words[1].lower(): try: - "".lower().index(l) + words[0].lower().index(l, 0) except ValueError: return False - return True \ No newline at end of file + return True