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 trial


Rating my Solution for Python Basic (Masterticket.py)

So I went through the course & attempted to do the last step with my own implementation. I used a global within a function & forums I've read generally considered that bad practice due to code smell (I figure in something small & starting out it was alright). So i'm curious how good or bad my implementation was & what would be a best practice to do. I am aware I could have probably refactored a bit with the .lower or uppers from the video later on.

Three other questions as well

So it may just be I need to finish the list courses etc. However was there a way to check in the confirmation step using the == against strings for multiples without having to use the (or) statement for each.

I didn't define any parameters in a function & was wondering if there is a reason why that could be bad, or just limits what my function could do.

Also in the except ValueError, I notice that craig uses the (as err) portion. I can't really tell the difference of what that does. If I could get a better explanation on how that is useful it would certainly fill in a blank.

Here's my solution to the problem & thank you for the time & any info.