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:
count = sum(1 for x, y in zip(strand_a, strand_b) if x != y)
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 💛
🅑🅐🅝🅙🅘
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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 💛
🅑🅐🅝🅙🅘