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..ad2f7ff --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + \ 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/fizzbuzz.py b/fizzbuzz.py new file mode 100644 index 0000000..6a44bd0 --- /dev/null +++ b/fizzbuzz.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/fizzbuzz_test.py b/fizzbuzz_test.py new file mode 100644 index 0000000..9eea0b4 --- /dev/null +++ b/fizzbuzz_test.py @@ -0,0 +1,6 @@ +from fizzbuzz import fb + +a = [1, 3, 5, 15] +b = [1, "fizz", "buzz", "fizzbuzz"] +for i in range(len(a)): + assert (fb(a[i]) == b[i]) diff --git a/helloworld.py b/helloworld.py index 449b948..f9c0051 100644 --- a/helloworld.py +++ b/helloworld.py @@ -1,2 +1,2 @@ def get_greetings(): - return 'Hello World!' + return 'Hello World!' \ No newline at end of file