Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Reiriz Irulegui, Iñigo
FizzBuzz
Commits
6740c36b
Commit
6740c36b
authored
Jul 16, 2020
by
Inigo Reiriz
Browse files
added fizzbuzz implementation
parent
a13dfb2c
Pipeline
#30209
passed with stage
in 35 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
0 → 100644
View file @
6740c36b
image
:
"
python:3.7"
before_script
:
-
pip install -r requirements.txt
test
:
script
:
-
pytest
tags
:
-
docker
fizzbuzz.py
View file @
6740c36b
def
fizzbuzz
(
n
:
int
)
->
str
:
def
fizzbuzz
(
n
:
int
)
->
str
:
"""
Write a program that prints the numbers from 1 to 100.
But for multiples of three print "Fizz" instead of the number
And for the multiples of five print "Buzz".
For numbers which are multiples of both three and five print "FizzBuzz".
"""
return
""
if
n
%
3
==
0
and
n
%
5
==
0
:
return
"FizzBuzz"
elif
n
%
3
==
0
:
return
"Fizz"
elif
n
%
5
==
0
:
return
"Buzz"
else
:
return
str
(
n
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment