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.
6 Antworten
+ 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)
+ 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)
+ 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
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