October 18th, 2012, 03:04 AM
LOL...I wish making it work was all i needed...hehe, i would have been done long ago,
my teachers mark everything including the quality of docstring...also, they want the summarized codes most of the time which they refer to as 'pythonic', and the closest thing i found on string was isalpha...
October 18th, 2012, 05:15 PM
Okay, so i made the code... Can someone check what is wrong with it??
def is_match (puzzle,view):
returns true iff puzzle and view match in the place
where the letters are hidden
>>>is_match ('apples-i', '^^^^^^-^')
>>>is_match ('apples-i', '^^^^^^^^')
a = 0
if len(view) == len(puzzle):
for i in range(len(puzzle)):
if (puzzle[i] != view[i] and view[i] != HIDDEN):
October 18th, 2012, 09:04 PM
Also consider "not".
Originally Posted by wikipedia
[/code] are essential for python code and Makefiles!