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

Python Python Basics (2015) Letter Game App Letter Game Refinement

Hussein Amr
Hussein Amr
2,461 Points

Why do we use the "draw" function twice?

why do we reuse the "draw" function again in line 83 in the video? we have already called it for the good guesses why call it again in the else? im completely confused right now

1 Answer

I think this is to update the user's screen... specifically, for the user to see a revised print out of all their bad guesses and their strikes when they lose... so that when the user enters the last bad guess (for example, "a"), "a" is added to the print out of bad guess and their strikes are updated at the top of the user's screen... there's less of a need to do this if, instead, "a" is the last good guess and the user wins the game.