+ 2
Why my code not works?
My not works for case 2 jn fizzbuzz problem. https://code.sololearn.com/ceorg59x7kyo/?ref=app
8 Respostas
+ 3
The code worked yesterday. The problem seems to related to ram in my phone. The changes i made was not updated in the code.
The logic and the syntax was all fine.
Thanks to friends who did help me.
+ 2
Martin Raj Kumar yeah, you are right. It is not printing even numbers.
I just run this code in the code project and it is working for both the cases.
+ 2
Martin Raj Kumar
I just ran your code in the test playground & it passed.
So I assume you have edited your code from the previous post.
Might I suggest that if your use of continue is not doing anything.
Your range statement bypasses the need for continue to be used as you generate odd numbers only.
If you were to create
for i in range(n)
then you would need to use continue, IE:
if i%2==0:
continue
This would allow the code to bypass even numbers within range.
+ 1
It is not printing even numbers. Please check.
+ 1
For x in range(1,n, 2) generates only even numbers
+ 1
In sololearn solution it works for case 1 but not for case 2
+ 1
Martin Raj Kumar In my phone, it is working for both cases.
See below :
https://www.sololearn.com/post/1260812/?ref=app
https://www.sololearn.com/post/1260816/?ref=app
0
Daniil Chernyshov In Fizzbuzz, we don't have to print even numbers.