Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNguyen Duong
Python Development Techdegree Student 3,071 PointsUnit 2 Baseball Stat Project of Python Techdegree
Hello! I am on Unit 2 Project of the Python Techdegree and it took me a long time to start figuring out how to go about it.
After cleaning the data as instructed, I managed to come up with something like this and have the three teams split evenly, with an equal amount of experienced and inexperienced players on each team.
My question is: Does this look right? I know it seems almost too basic or elementary, I'm not sure if there might be a more efficient way of doing it that's more complex. I just did what I could from scratch and this is the best I could come up with at the moment with my knowledge as of now.
If I am heading in the right direction the rest of the project I should be able to figure out. I just wanted feedback up until now to see if maybe I am missing something or if the way I arrived here is too rudimentary. :(
Thank you for your time and effort!
Snapshot of my code:
2 Answers
Nguyen Duong
Python Development Techdegree Student 3,071 PointsThank you for the detailed response! Much, much appreciated :)
Nguyen Duong
Python Development Techdegree Student 3,071 PointsJeff Muday I tried to make your answer the best answer but can't for some strange reason. I apologize.
Jeff Muday
Treehouse Moderator 28,720 PointsJeff Muday
Treehouse Moderator 28,720 PointsThe thing I love about Python (well for that matter, programming) is there are MANY ways to write a good project!
This is quite nice, so far, but you have some refactoring to do to complete the specifications for the assignment.
Disclaimer: I am just a moderator, so I don't know much about your Techdegree.
Comments (based on the specifications):
constants.py
in yourapp.py
. This demonstrates your understanding of "separation of concerns"constants.py
toapp.py
app.py
clean_data()
is pretty good. I can think of style hints, but this is good as is. You demonstrated encapsulation.allocate_teams(players_new)
OR separate them into two functionsseparate_experience(new_players)
andallocate_teams(experienced, inexperienced)
main()
to include calls toclean_data()
,allocate_players()
,print_players()
Keep going, you are doing great!