Can u help me in this question ? Not answer only help please ? | Sololearn: Learn to code for FREE!
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)

27th Nov 2020, 7:06 AM
Qudrat Iskandarov
Qudrat Iskandarov - avatar
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
27th Nov 2020, 7:13 AM
ㅤㅤㅤ
+ 2
Thank you all for helping i got u. I understood my mistakes
27th Nov 2020, 7:39 AM
Qudrat Iskandarov
Qudrat Iskandarov - avatar
+ 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.
27th Nov 2020, 7:16 AM
ChaoticDawg
ChaoticDawg - avatar
+ 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.
27th Nov 2020, 7:21 AM
ChaoticDawg
ChaoticDawg - avatar
+ 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
27th Nov 2020, 7:31 AM
Ipang
0
Result should be like this: 1 Solo Learn 7 Solo 11 13
27th Nov 2020, 7:18 AM
Qudrat Iskandarov
Qudrat Iskandarov - avatar
0
But i was not able to solve it
27th Nov 2020, 7:19 AM
Qudrat Iskandarov
Qudrat Iskandarov - avatar
0
Can u show the example?
27th Nov 2020, 7:30 AM
Qudrat Iskandarov
Qudrat Iskandarov - avatar