Explain the answer | Sololearn: Learn to code for FREE!


Explain the answer

FizzBuzz is a well known programming assignment, asked during interviews. The given code solves the FizzBuzz problem and uses the words "Solo" and "Learn" instead of "Fizz" and "Buzz". It takes an input n and outputs the numbers from 1 to n. For each multiple of 3, print "Solo" instead of the number. For each multiple of 5, prints "Learn" instead of the number. For numbers which are multiples of both 3 and 5, output "SoloLearn". You need to change the code to skip the even numbers, so that the logic only applies to odd numbers in the range.

12/13/2020 8:20:34 AM

Ravi Kumar

4 Answers

New Answer


Arvind Kumar I already gave you 4-5 hint with proper explaination. Do self and come back if facing problem.


Arvind Kumar,If you are a real programmer you should do it yourself not to copy answer from other.I Am Groot ! already gave you the hint. So please try it yourself.If you can't solve this. Read the lessons of python and we cannot give you the full code as it is against sololearn rules.


Arvind Kumar You have to print "Solo" when number is multiple of 3 and print "Learn" when number is multiple of 5 and "SoloLearn" if number is multiple of both 3 and 5. Do not print anything if number is multiple of 2. Remember 10 is multiple of 2 but it's also multiple of 5 so you have to print "Learn" in this case.


I Am Groot ! Bro can you send me the solution