diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/fizzbuzz-python-tdd-scaffold.iml b/.idea/fizzbuzz-python-tdd-scaffold.iml new file mode 100644 index 0000000..7c9d48f --- /dev/null +++ b/.idea/fizzbuzz-python-tdd-scaffold.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8656114 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..890fc34 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/helloword.py b/helloword.py new file mode 100644 index 0000000..6a44bd0 --- /dev/null +++ b/helloword.py @@ -0,0 +1,8 @@ +def fb(n): + if n % 15 == 0: + return "fizzbuzz" + if n % 3 == 0: + return "fizz" + if n % 5 == 0: + return "buzz" + return n diff --git a/helloword_test.py b/helloword_test.py new file mode 100644 index 0000000..36599c3 --- /dev/null +++ b/helloword_test.py @@ -0,0 +1,6 @@ +from helloword import fb + +a = [1, 3, 5, 15] +b = [1, "fizz", "buzz", "fizzbuzz"] +for i in range(len(a)): + assert (fb(a[i]) == b[i])