diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..757f3cf --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,12 @@ +{ + "python.testing.unittestArgs": [ + "-v", + "-s", + "./__pycache__", + "-p", + "*test.py" + ], + "python.testing.pytestEnabled": false, + "python.testing.nosetestsEnabled": false, + "python.testing.unittestEnabled": true +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..204d632 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,19 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "TDD", + "type": "shell", + "command": "python", + "args": [ + "c:/Users/Michael/Documents/Python Scripts/2/testFizzBuzz.py" + ], + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} \ No newline at end of file diff --git a/f.py b/f.py new file mode 100644 index 0000000..e8e25b2 --- /dev/null +++ b/f.py @@ -0,0 +1,3 @@ +def f(n): + return 'fizzbuzz' if n % 15 == 0 else 'fizz' \ + if n % 3 == 0 else 'buzz' if n % 5 == 0 else n diff --git a/testFizzBuzz.py b/testFizzBuzz.py new file mode 100644 index 0000000..94eefd2 --- /dev/null +++ b/testFizzBuzz.py @@ -0,0 +1,5 @@ +from f import * +assert f(1) == 1 +assert f(3) == 'fizz' +assert f(5) == 'buzz' +assert f(15) == 'fizzbuzz'