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 trial

iOS

Sena Sari
seal-mask
.a{fill-rule:evenodd;}techdegree
Sena Sari
Python Web Development Techdegree Student 9,855 Points

why 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
Colton Ehrman
255 Points

It would be helpful if your question had some context, cannot tell what it is you are referring to.

Colton Ehrman
Colton Ehrman
255 Points

In 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
seal-mask
.a{fill-rule:evenodd;}techdegree
Sena Sari
Python Web Development Techdegree Student 9,855 Points

I 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.