+ 2

Why my code not works?

My not works for case 2 jn fizzbuzz problem. https://code.sololearn.com/ceorg59x7kyo/?ref=app

28th Aug 2021, 9:42 AM
Martin Raj Kumar
Martin Raj Kumar - avatar
8 odpowiedzi
+ 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.
29th Aug 2021, 5:10 AM
Martin Raj Kumar
Martin Raj Kumar - avatar
+ 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.
28th Aug 2021, 9:58 AM
UD∆Y ∆.🇮🇳 [Inactive]
+ 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.
28th Aug 2021, 10:07 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
It is not printing even numbers. Please check.
28th Aug 2021, 9:48 AM
Martin Raj Kumar
Martin Raj Kumar - avatar
+ 1
For x in range(1,n, 2) generates only even numbers
28th Aug 2021, 9:55 AM
Martin Raj Kumar
Martin Raj Kumar - avatar
+ 1
In sololearn solution it works for case 1 but not for case 2
28th Aug 2021, 9:59 AM
Martin Raj Kumar
Martin Raj Kumar - avatar
28th Aug 2021, 10:02 AM
UD∆Y ∆.🇮🇳 [Inactive]
0
Daniil Chernyshov In Fizzbuzz, we don't have to print even numbers.
29th Aug 2021, 12:49 AM
UD∆Y ∆.🇮🇳 [Inactive]