comparing text strings

Siggy Brentrup bsb at winnegan.de
Sun Jan 2 04:42:25 EST 2000


"NuclearZen" <NuclearZen at home.com> writes:

> this is probably the stupidest Q's of all time but  Idont know how to
> compare text strings in python.  How?  I try to do it like C, or perl but???

Since python is an interpreted language, you can easily experiment:

Python 1.5.2+ (#4, Nov 18 1999, 01:39:08)  [GCC egcs-2.91.66 19990314 (egcs-1.1.2 release)] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
IDLE 0.5 -- press F1 for help
>>> s1="I'm a string"
>>> s2="I'm a string"
>>> s3="I'm different"
>>> s1 == s1
1
>>> s1 == s2
1
>>> s1 == s3
0
>>> 

HIH
  Siggy

-- 
Siggy Brentrup - bsb at winnegan.de - http://www.winnegan.de/
****** ceterum censeo javascriptum esse restrictam *******




More information about the Python-list mailing list