Why its not accepting my code😡 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
5th May 2021, 6:22 AM
Akash Prasad
Akash Prasad - avatar
5 Answers
+ 6
You just need to add 2 in argument of for loop n = int(input()) for n in range(1, n ,2): if n % 3 == 0 and n % 5 == 0: print("SoloLearn") elif n % 3 == 0: print("Solo") elif n % 5 == 0: print("Learn") else: print(n)
5th May 2021, 5:41 PM
Aysha
Aysha - avatar
+ 1
Its working fine. I think you should make us clear what you want to actually do with the program and whats your error
5th May 2021, 7:28 AM
Vijay Gunwant
Vijay Gunwant - avatar
+ 1
#Akash Prasad here is your solution n = int(input()) for x in range(1, n): if not(x % 2 == 0): if x % 3 == 0 and x % 5 == 0: print("SoloLearn") elif x % 3 == 0: print("Solo") elif x % 5 == 0: print("Learn") else: print(x) #1) You have not capitalized the L in "SoloLearn #2) In else statement you have to print x not n. #I hope it helps the above code is working as I have complete that problem
5th May 2021, 11:23 PM
Vijay Gunwant
Vijay Gunwant - avatar
0
Works as designed..
5th May 2021, 7:21 AM
Oma Falk
Oma Falk - avatar
0
Actually i am in python core course Where i have to submit code When i submitted the expected output is same as my code gives output but it is not accepting And why its not accepting i dont know 🤔
5th May 2021, 5:31 PM
Akash Prasad
Akash Prasad - avatar