0
Всeм привет друзья я тут немного тупанул и мне нужна помощь остальное в описании
FizzBuzz — это популярная задача, которая часто дается в ходе собеседования. Предложенный код разрешает проблему FizzBuzz и использует слова "Solo" и "Learn" вместо "Fizz" и "Buzz". Он берет ввод n и выводит числа от 1 до n. Для каждого числа, кратного 3, печатает "Solo" вместо числа. Для каждого числа, кратного 5, печатает "Learn" вместо числа. Для чисел, кратных 3 и 5, выводит "SoloLearn". Вам необходимо написать код, чтобы пропускать четные числа, чтобы данная логика применялась только к нечетным числам диапазона.
6 Respostas
+ 4
Вот
+ 1
Add 2 after n like this:
for...(1,n,2)
As they shouldnt be even numbers
Rest of the code is right
Добавьте 2 после n следующим образом:
 для...(1,n,2)
 Поскольку они должны быть четными числами
 Остальной код правильный
0
Q.
Hello friends, I'm a little dumb here and I need help, the rest is in the description
 FizzBuzz is a popular task often given during job interviews.
 The proposed code solves the FizzBuzz problem and uses the words "Solo" and "Learn" instead of "Fizz" and "Buzz".
 It takes input n and outputs numbers from 1 to n.
 For every number that is a multiple of 3, prints "Solo" instead of a number.
 For every number that is a multiple of 5, prints "Learn" instead of the number.
 For multiples of 3 and 5, outputs "SoloLearn".
 You need to write code to skip even numbers so that this logic only applies to the odd numbers in the range.
(Language: Russian)
A. So where is your try?
Так где твоя попытка?
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)
0
Ок спасибо большое
0
n = int(input())
#Нужно добавить 2 после n то есть мы укажем шаг в 2 цифры тоесть только четные
for num in range(1, n, 2):
    if num % 3 == 0 and num % 5 == 0:
        print("SoloLearn")
    elif num % 3 == 0:
        print("Solo")
    elif num % 5 == 0:
        print("Learn")
    else:
        print(num)



