0

Помогите решить задачу FizzBuzz

Нужно решить задачу

24th Nov 2020, 4:34 PM
Biohazard
Biohazard - avatar
8 odpowiedzi
+ 3
Тебе не совсем правильно говорили.В 3 строку нужно добавить 2.Правильный код ниже: n = int(input()) for x in range(1, n,2): 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)
29th Dec 2020, 6:13 PM
MaryRif
MaryRif - avatar
+ 2
Try these links. Maybe it will help you.
25th Nov 2020, 7:21 PM
Loertas
0
Biohazard , you didn't provide the description of the task. Also show your attempt, so somebody can help you.
24th Nov 2020, 4:56 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
0
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) continue
24th Nov 2020, 5:00 PM
Biohazard
Biohazard - avatar
0
Biohazard , it is mentioned in the task that you should skip the even numbers. I don't see it in your code.
24th Nov 2020, 5:05 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
0
https://www.sololearn.com/Discuss/2548320/?ref=app
25th Nov 2020, 7:20 PM
Loertas
- 1
n = int(input()) for x in range(1, n): if x % 2 != 0: if x%3==0 and x%5==0: print('SoloLearn') elif x%3==0 and x%5!=0: print ('Solo') elif x%5==0 and x%3!=0: print ('Learn') else: print (x)
25th Nov 2020, 7:21 PM
Pavel O
Pavel O - avatar