Ah goddammit, I should have known better. Thank you.
Classic pythonic mistake of yours, here. ;)
look a the following message... ;o
This comment is hidden because it contains spoiler information about the solution
Ah yes, you're right. Still pretty confusing since all the basic tests are 20 characters long.
I've passed all the tests in JS, but using the same logic in Python, I get different results. If the amino list isn't passed in , it's default to ['A','I','L','M','F','W','Y','V']. Is my logic wrong in thinking that I should simply count the number of chars that are in the amino list vs the string and taking that as a percentage?
not an issue, you misunderstood the sentence: this actually tells that there are 20 amino acids with which you can build the proteins. That's not the nombre of AA per protein (often, one protein consists of thousands of AA).
do you get that in JS or in python? (edit: python, since snake_case... I'll take a look)
Are the tests consistent between JS and Python?
aa_percentage('CPRVPYYKKHDLQDTRHTIFHVFV'), should the result not be 38? Instead it expects 0.
Holy shit, this wrecked me and conceptually it isn't really that hard.
You also have to remember that this is codewars. If the code needed to be time critical, the tests would reflect that. Speaking of which, if your code needs to be time critical in the real world, Python isn't the language for you, otherwise it's good enough for most jobs ;)