Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSena Sari
Python Web Development Techdegree Student 9,855 Pointswhy not use %15 instead of 3 and 5
I have used n%15 instead of using both 3 and 5 and it worked perfectly well. I'm not sure we used both %3 and %5 instead. Could someone clarify please? Question is in this link : https://teamtreehouse.com/library/introducing-fizzbuzz Answer is in this link: https://teamtreehouse.com/library/solution-to-fizzbuzz
2 Answers
Colton Ehrman
255 PointsIt would be helpful if your question had some context, cannot tell what it is you are referring to.
Colton Ehrman
255 PointsIn programming, there are many different ways you can accomplish something. As you have seen, your solution works just as well as the other solution. There is no reason why to use one over the other, mainly just personal preference. I hope this helps.
Sena Sari
Python Web Development Techdegree Student 9,855 PointsI understand that but I am just curious if there was any other reason to use 3 and 5 separately, like exceptional cases. the reason why my code worked could've been just luck. But thanks for your answer and time.
Sena Sari
Python Web Development Techdegree Student 9,855 PointsSena Sari
Python Web Development Techdegree Student 9,855 PointsYou're right. I added some