FizzBuzz solutions | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

FizzBuzz solutions

Hello I wanted to know how you guys have solved the FizzBuzz here is the Code: https://code.sololearn.com/cA79a6A20a21 I have done this myself but I am curious about how others have solved this since there is no comment to show how people solved.

15th Jan 2021, 1:05 PM
Ace
Ace - avatar
4 Answers
+ 8
n = int(input()) for x in range(1, n,2): if x % 3 == 0 and x % 5 == 0: print("SoloLearn") continue elif x % 3 == 0: print("Solo") continue elif x % 5 == 0: print("Learn") continue else: print(x)
15th Jan 2021, 1:17 PM
VṢtēphen
VṢtēphen - avatar
+ 3
Here is how I did it n= int(input()) for x in range(1,n): if (x>1): if x%2==1: if x%3==0 and x%5==0: print(f"{x}SoloLearn") elif x%3==0: print("Solo") elif x%5==0: print("Learn") else: print(x) else: print(x)
15th Jan 2021, 1:22 PM
Ace
Ace - avatar
+ 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) https://code.sololearn.com/cCL4NOO1v75B/?ref=app
16th Jan 2021, 11:15 AM
SpaceBarMönkey
SpaceBarMönkey - avatar
0
Here is the question and the default code: https://code.sololearn.com/cA79a6A20a21 and the project its self: https://www.sololearn.com/learning/eom-project/1073/612 If this was what you asked for otherwise I don't know how else I could share it with you Kiibo
15th Jan 2021, 3:24 PM
Ace
Ace - avatar