- Notifications
You must be signed in to change notification settings - Fork 366
/
Copy pathFizzBuzz.py
19 lines (18 loc) · 803 Bytes
/
FizzBuzz.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'''
@Coded by TSG
Problem:
FizzBuzz is a well known programming assignment, asked during interviews.
The given code solves the FizzBuzz problem and uses the words "Solo" and "Learn" instead of "Fizz" and "Buzz".
It takes an input n and outputs the numbers from 1 to n.
For each multiple of 3, print "Solo" instead of the number.
For each multiple of 5, prints "Learn" instead of the number.
For numbers which are multiples of both 3 and 5, output "SoloLearn".
You need to change the code to skip the even numbers, so that the logic only applies to odd numbers in the range.
'''
# Code goes here
forxinrange(1, int(input())):
ifx%2==0: continue
ifx%3==0andx%5==0: print("SoloLearn")
elifx%3==0: print("Solo")
elifx%5==0: print("Learn")
else: print(x)