Problems with string and lists (searching and replaceing)
jblazi at hotmail.com
Sun Sep 21 08:55:08 CEST 2003
I shall have a computer science class this year and I decided to use
Python. It is my favourite language and I have used it for many years. Now
I thought, one of our first "real" programs, in our pre-graphical and
pre-class state, would be to write simple program that works like this:
One of the pupils enters a word. It should be a valid German word
consisting of five letters, for example 'abcde' (which is not a German
word by the way).
The the other player may enter a guess which must be a five letter word as
well, for example 'xbxxx'. Then the system answers with the string '-*---'
as the 'b' in 'xbxxx' was correct and at the right place as well.
Had the second player entered 'xxxbx', the system had responded with
'---.-', as the 'b' is correct but not correctly positioned.
The second player must find out the original word.
Now I did not see how to do it as simply as posible, that was the problem.
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
More information about the Python-list