I'm no noob, but here it is(less lines and more pythonic):
defdistance(strand_a,strand_b):iflen(strand_a)!=len(strand_b):raiseValueError("Length of two sequences most be the same")zip_a_b=zip(strand_a,strand_b)count=len([xforx,yinzip_a_bifx!=y])returncount
Hey Jeremy, thank you for sharing a better and clever solution in this post.
thank you for reading this post and leaving a comment to improve this solution.
Happy Coding with LoVe
I'm no noob, but here it is(less lines and more pythonic):
Your's was okay though.
Hey Sean, tnx for sharing your better way to improve this solution.
Happy coding with LoVe
Both are great! But, it feels weird to create and throw away a list just for its length. I thought this generator expression solution was clever:
Source: Stack Overflow
Way smarter, totally tosses the array. Absolutely, and perfecly, pythonic.
Hey Jeremy, thank you for sharing a better and clever solution in this post.
thank you for reading this post and leaving a comment to improve this solution.
Happy Coding with LoVe
I'm gonna edit my post and add your great solution in my post.
Thank you :)
Keep Moving Forward ツ
Code with 💛
🅑🅐🅝🅙🅘