0
Помогите решить задачу FizzBuzz
Нужно решить задачу
8 Réponses
+ 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)
+ 2
Try these links. Maybe it will help you.
0
Biohazard , you didn't provide the description of the task. Also show your attempt, so somebody can help you.
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
0
Biohazard , it is mentioned in the task that you should skip the even numbers. I don't see it in your code.
0
https://www.sololearn.com/Discuss/2548320/?ref=app
- 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)