Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 08-pizza-party/python-pizza-party/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
##to run

```
./main.py
python3 main.py
```

##tests

```
python -m unittest discover -s tests
python3 -m unittest discover -s tests
```
5 changes: 2 additions & 3 deletions 08-pizza-party/python-pizza-party/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python3

from __future__ import print_function
from party import PizzaParty


Expand All @@ -18,4 +17,4 @@ def run(read, prt):
prt('There are %s leftover pieces.' % (party.leftovers()))

if __name__ == "__main__":
run(raw_input, print)
run(input, print)
2 changes: 1 addition & 1 deletion 08-pizza-party/python-pizza-party/party/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from party import PizzaParty # noqa F401
from .party import PizzaParty # noqa: F401
2 changes: 1 addition & 1 deletion 08-pizza-party/python-pizza-party/party/party.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def order(self, pizzas, size=None):
return self

def pieces_per_person(self):
return self.slices / self.people
return self.slices // self.people

def leftovers(self):
return self.slices % self.people
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ FROM lochnesh/exercises-docker:latest

MAINTAINER Skyler Nesheim

RUN set -eux; \
apk add --no-cache python3

COPY ./ /usr/src/exercises
WORKDIR /usr/src/exercises
RUN ./verify.sh
7 changes: 6 additions & 1 deletion verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ verify_python()
python -m unittest discover -s tests
}

verify_python3()
{
python3 -m unittest discover -s tests
}

verify_scala()
{
sbt scalastyle test:scalastyle assembly
Expand Down Expand Up @@ -40,7 +45,7 @@ pushd 06-retirement-calculator/elixir_retirement_calculator && verify_elixir &&
pushd 07-area-of-room/elixir_area_of_room && verify_elixir && popd

#08
pushd 08-pizza-party/python-pizza-party && verify_python && popd
pushd 08-pizza-party/python-pizza-party && verify_python3 && popd

#09
pushd 09-paint-calculator/scala-paint-calculator && verify_scala && popd
Expand Down