You are viewing a single comment's thread from:
RE: Solution To Reggaemuffin's Coding Challenge - Python + Code Explanation and Logic
Nice clean solution. One improvement could be to concatenate fizz and/or buzz to an initially empty string. That way you only need the checks for % 3 and % 5, and the check for % 15 will come automatically as a result of those two.
Yes you're right, thanks for the feedback and the advice, appreciated. There's a few ways of doing this, even with one single line of code but I wrote it this way just to explain the underlying logic behind it for people who are trying to learn. I'm still pretty new to Python as well, trying to teach people as I learn the Python ways :)