-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
32 lines (26 loc) · 771 Bytes
/
app.py
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
32
"""This is a sample app for the docker container example.
It calculates the fizzbuzz, and thats it."""
import pandas as pd
def fizzbuzz(max_n: int = 100) -> []:
"""
Goes through n numbers and sees if they are divisible by
3, 5, or both.
Returns a list of the results.
"""
output = []
for i in range(max_n):
if i % 15 == 0:
output.append("FizzBuzz")
elif i % 3 == 0:
output.append("Fizz")
elif i % 5 == 0:
output.append("Buzz")
else:
output.append(str(i))
return output
if __name__ == "__main__":
# Creates a dataframe and populates a column
# with the results of fizzbuzz().
df = pd.DataFrame()
df["FizzBuzz"] = fizzbuzz()
print(df)