This course will be retired on June 22, 2018. We recommend "Python Basics" for up-to-date content.
Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Letter Game Takeaways0:44 with Kenneth Love
Like our other two apps, this game taught us quite a bit.
Wow, 100 lines! We did a lot in this stage so let's talk about it.
osto detect the operating system and run a system-level command to clear the screen
- Use the
syslibrary to cleanly exit our program
- Used the
print()to change whether or not a new line is printed
Just like our shopping list and our number guessing game,
this letter game helps us master a lot more of Python and programming in general.
Taking some extra steps to present a nice UI to your users
makes your product more professional and nice to use.
Exiting cleanly will help other programs on your computer know what's going on.
And again, the standard library gives us a ton of useful features for free.
If you want to, look up the open function in the Python docs and see if you can use
that and the read method to move the list of words to a separate file.
That way you can add and
remove words from the list without having to worry about your game code.
Also, making the number of guesses change,
based on the length of the word could make the game a lot more difficult.
Give both of those things a try.
You need to sign up for Treehouse in order to download course files.Sign up