+ 1
Fuzzbuzz prblm, first case is correct but 2nd is wrong,....
How can i correct my fizzbuzz problem:- n = int(input()) for i in range(1,n,2): if i % 3 == 0: print("Solo") elif i % 5 == 0: print("Learn") elif i % 3 == 0 and i % 5== 0: print("Solo Learn") else: print(i)
3 Respostas
+ 4
Ashish Mishra in third print Statement there is space between Solo and learn see properly what u have to print remove this space
+ 4
Hi Ashish!
It prints Solo for all numbers that divisible by 15(3 and 5) instead of Solo Learn. That's because, you started your if-else statements with divisible by 3 but 15 is also divisible by 3.
For that, you can start with 3 and 5 instead. So, it will check all numbers properly.
+ 2
I want to solve hidden case .... first case is right but second is wrong....how?