check50

cs50/problems/2022/python/pizza


:) pizza.py exists

Log
checking that pizza.py exists...

:) pizza.py exits given no command-line arguments

Log
running python3 pizza.py...

:) pizza.py exits given non-existent file

Log
running python3 pizza.py non_existent.csv...

:) pizza.py exits given non-csv file

Log
running python3 pizza.py sicilian.txt...

:) pizza.py exits given too many command-line arguments

Log
running python3 pizza.py regular.csv sicilian.csv...

:( pizza.py renders prices from sicilian.csv

Cause
expected "+-------------...", not "+-------------..."

Log
running python3 pizza.py sicilian.csv...
checking for output "+------------------+---------+---------+\n| Sicilian Pizza | Small | Large |\n+==================+=========+=========+\n| Cheese | $25.50 | $39.95 |\n+------------------+---------+---------+\n| 1 item | $27.50 | $41.95 |\n+------------------+---------+---------+\n| 2 items | $29.50 | $43.95 |\n+------------------+---------+---------+\n| 3 items | $31.50 | $45.95 |\n+------------------+---------+---------+\n| Special | $33.50 | $47.95 |\n+------------------+---------+---------+"...

Expected Output:
+------------------+---------+---------+
| Sicilian Pizza   | Small   | Large   |
+==================+=========+=========+
| Cheese           | $25.50  | $39.95  |
+------------------+---------+---------+
| 1 item           | $27.50  | $41.95  |
+------------------+---------+---------+
| 2 items          | $29.50  | $43.95  |
+------------------+---------+---------+
| 3 items          | $31.50  | $45.95  |
+------------------+---------+---------+
| Special          | $33.50  | $47.95  |
+------------------+---------+---------+
Actual Output:
+------------------+---------+---------+
| Sicilian Pizza   | Small   | Large   |
|                  |         |         |
+==================+=========+=========+
| Cheese           | $25.50  | $39.95  |
+------------------+---------+---------+
| 1 ite...

:( pizza.py renders prices from regular.csv

Cause
expected "+-------------...", not "+-------------..."

Log
running python3 pizza.py regular.csv...
checking for output "+-----------------+---------+---------+\n| Regular Pizza | Small | Large |\n+=================+=========+=========+\n| Cheese | $13.50 | $18.95 |\n+-----------------+---------+---------+\n| 1 topping | $14.75 | $20.95 |\n+-----------------+---------+---------+\n| 2 toppings | $15.95 | $22.95 |\n+-----------------+---------+---------+\n| 3 toppings | $16.95 | $24.95 |\n+-----------------+---------+---------+\n| Special | $18.50 | $26.95 |\n+-----------------+---------+---------+"...

Expected Output:
+-----------------+---------+---------+
| Regular Pizza   | Small   | Large   |
+=================+=========+=========+
| Cheese          | $13.50  | $18.95  |
+-----------------+---------+---------+
| 1 topping       | $14.75  | $20.95  |
+-----------------+---------+---------+
| 2 toppings      | $15.95  | $22.95  |
+-----------------+---------+---------+
| 3 toppings      | $16.95  | $24.95  |
+-----------------+---------+---------+
| Special         | $18.50  | $26.95  |
+-----------------+---------+---------+
Actual Output:
+-----------------+---------+---------+
| Regular Pizza   | Small   | Large   |
|                 |         |         |
+=================+=========+=========+
| Cheese          | $13.50  | $18.95  |
+-----------------+---------+---------+
| 1 topping  ...