Demo console-based basketball team statistics app that divides a group of players into teams and presents statistics about each team.
Features
- Uses various Python data types to store and manipulate data into organized team structures.
- Cleans data from
constants.py
without changing the original data.- Converts string data into integers or floats.
- Converts string data into Boolean values.
- Converts string data into lists of strings.
- Organizes player data evenly into teams ensuring each team has the same number of experienced and inexperienced players.
- Provides Dunder Main usage examples in
app.py
entry point anddm.py
module. - Presents data in a nice readable format using extra spaces and line breaks ('\n') to break up lines.
- User is re-prompted with the main menu until they decide to "Quit the program".
python3 app.py
NOTE: Python 3.10 was used to develop and test this app.
Some basic unit tests are included to test the dm.py
module.
Expand/Collapse
To run the tests, use something like:python3 -m unittest -v dm.py
and you should see some test result output like this:
test_balance_teams (dm.Tests) ... ok
test_calculate_avg_height (dm.Tests) ... ok
test_cleaned_players (dm.Tests) ... ok
test_create_string_from_list_of_lists (dm.Tests) ... ok
test_show_menu_options (dm.ToDoTests) ... skipped "TODO: When there's more time, test this"
test_show_team_stats (dm.ToDoTests) ... skipped "TODO: When there's more time, test this"
----------------------------------------------------------------------
Ran 6 tests in 0.001s
OK (skipped=2)
Note: If you run dm.py
directly, with something like:
python3 dm.py
You should see test result output like this:
....ss
----------------------------------------------------------------------
Ran 6 tests in 0.000s
OK (skipped=2)
The ....ss
indicates four tests ran and two were skipped.