Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!gordon From: John Gordon Newsgroups: comp.lang.python Subject: Re: new to python, help please !! Date: Wed, 11 Nov 2015 16:58:22 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 27 Message-ID: References: <93aef8e5-3d6f-41f4-a625-cd3c2007686e@googlegroups.com> NNTP-Posting-Host: panix1.panix.com X-Trace: reader1.panix.com 1447261102 6737 166.84.1.1 (11 Nov 2015 16:58:22 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 11 Nov 2015 16:58:22 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.python:98649 In <93aef8e5-3d6f-41f4-a625-cd3c2007686e@googlegroups.com> Anas Belemlih writes: > i=0 > s1=line1[i] > s2=line2[i] > count = 0 > if number1 != number2: > print " hash table not the same size" > else: > while count < number1: > if s1 == s2: > print " character", line1[i]," matchs" > i=i+1 > count=count+1 > else > print "Hash values corrupt" It looks like you're expecting s1 and s2 to automatically update their values when i gets incremented, but it doesn't work like that. When you increment i, you also have to reassign s1 and s2. -- John Gordon A is for Amy, who fell down the stairs gordon@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies"