about | help | code help+videos | done | prefs |
Given strings x and s, where s has length 3, count the occurrences of s as a substring of x, starting at an index which is a multiple of 3. (Hint: the range() function can take three arguments, try range(0,10,3).) count_codons('agctagctagctagctagcta', 'agc') → 2 count_codons('agctagctagctagctagcta', 'cta') → 2 count_codons('agcagcagcagc', 'agc') → 4 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy