Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #17850
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsreader4.netcologne.de!news.netcologne.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | tinnews@isbd.co.uk |
| Newsgroups | comp.lang.python |
| Subject | How to check for single character change in a string? |
| Date | Sat, 24 Dec 2011 15:26:21 +0000 |
| Lines | 18 |
| Message-ID | <th7hs8-one.ln1@chris.zbmc.eu> (permalink) |
| X-Trace | individual.net xEAPNJ8l1d3p2bx/mFrA4wfAAL0EC0sl8IlHllZzm+kCtTiTc= |
| X-Orig-Path | not-for-mail |
| Cancel-Lock | sha1:kp5ulNj6LGXuLO1xO5ZactyQl+Q= |
| User-Agent | tin/2.0.0-20110623 ("Burnside") (UNIX) (Linux/3.0.0-14-generic (x86_64)) |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:17850 |
Show key headers only | View raw
Can anyone suggest a simple/easy way to count how many characters have
changed in a string?
E.g. giving results as follows:-
abcdefg abcdefh 1
abcdefg abcdekk 2
abcdefg gfedcba 6
Note that position is significant, a character in a different position
should not count as a match.
Is there any simpler/neater way than just a for loop running through
both strings and counting non-matching characters?
--
Chris Green
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
How to check for single character change in a string? tinnews@isbd.co.uk - 2011-12-24 15:26 +0000
Re: How to check for single character change in a string? Roy Smith <roy@panix.com> - 2011-12-24 10:57 -0500
Re: How to check for single character change in a string? Roy Smith <roy@panix.com> - 2011-12-24 11:10 -0500
Re: How to check for single character change in a string? Arnaud Delobelle <arnodel@gmail.com> - 2011-12-24 17:09 +0000
Re: How to check for single character change in a string? Rick Johnson <rantingrickjohnson@gmail.com> - 2011-12-24 10:22 -0800
Re: How to check for single character change in a string? tinnews@isbd.co.uk - 2011-12-26 22:37 +0000
Re: How to check for single character change in a string? Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-24 08:57 -0700
csiph-web