New course! Every coder should learn Generative AI!
Try a free lesson0
Why its not accepting my code😡
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)
+ 1
Its working fine.
I think you should make us clear what you want to actually do with the program and whats your error
+ 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
0
Works as designed..
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 🤔