New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Can u help me in this question ? Not answer only help please ?
n = int(input()) for x in range(1, n): 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)
8 Answers
+ 4
Qudrat Iskandarov Your code is working properly,not showing any error what type of help you want?
https://code.sololearn.com/c9pF9qcblGoX/?ref=app
+ 2
Thank you all for helping i got u. I understood my mistakes
+ 1
You're forgetting to skip even numbers.
FYI, you can check if a number is a multiple of 3 and 5 by using 15.
Also, the L in learn needs to be capitalized.
+ 1
Make your first if statement a check to see if the number is divisible by 2. If so use the 'continue' keyword to go to the next iteration of the loop.
+ 1
You can also use the optional stepping parameter of `range`. By default `range` uses 1 as stepping, you can set the stepping to 2 in order to increase <x> by 2 on each run.
for x in range(1, n, 2):
# code here
0
Result should be like this:
1
Solo
Learn
7
Solo
11
13
0
But i was not able to solve it
0
Can u show the example?