FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
hackerrank-python-basic-skill-test/fizzbuzz.py at master · anishLearnsToCode/hackerrank-python-basic-skill-test · GitHub
anishLearnsToCode
/
hackerrank-python-basic-skill-test
Public
Notifications
You must be signed in to change notification settings
Fork
43
Star
59
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
hackerrank-python-basic-skill-test
/
fizzbuzz.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (24 loc) · 528 Bytes
Breadcrumbs
hackerrank-python-basic-skill-test
/
fizzbuzz.py
Copy path
File metadata and controls
31 lines (24 loc) · 528 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/python3
import
math
import
os
import
random
import
re
import
sys
#
# Complete the 'fizzBuzz' function below.
#
# The function accepts INTEGER n as parameter.
#
def
fizzBuzz
(
n
):
for
number
in
range
(
1
,
n
+
1
):
if
number
%
3
==
0
and
number
%
5
==
0
:
print
(
'FizzBuzz'
)
elif
number
%
3
==
0
:
print
(
'Fizz'
)
elif
number
%
5
==
0
:
print
(
'Buzz'
)
else
:
print
(
number
)
if
__name__
==
'__main__'
:
n
=
int
(
input
().
strip
())
fizzBuzz
(
n
)
Back
|
FazBrowse Home
|
New Git URL