Replace blanks with letter

Dave Angel davea at davea.name
Tue Aug 20 17:54:11 EDT 2013


eschneider92 at comcast.net wrote:

> Is there also a way to have the code remember what I typed and not stop after the first letter the user types? For example, if I typed 'a' once, thus returning 'a______', and then typed in 'b', I want the code to return 'ab_____' and so on. I wasn't clear about this part in my original post. Thanks for the help.

First you need some kind of loop.  There's only one call to input() in
your present code, so the question is meaningless.

Roughly speaking, make sure the following line is NOT in your loop:

blanks='_ '*len(letters)

-- 
DaveA




More information about the Python-list mailing list