[Zope] lower(), how?

Randall F. Kern randy@spoke.net
Thu, 19 Jul 2001 08:07:54 -0700


You are probably using Python 1.5.2, whereas Michel was using a more
recent build.

In 1.5.2, use the string module:

import string
n =3D raw_input("Guess a number between 1 and 100")
n =3D string.lower(n)

String methods (the ability to say "Foo".lower()) was added in Python
1.6.

-Randy

> -----Original Message-----
> From: Peter Bengtsson [mailto:mail@peterbe.com]
> Sent: Thursday, July 19, 2001 7:42 AM
> To: michel@digicool.com; zope@zope.org
> Subject: [Zope] lower(), how?
>=20
>=20
> I saw this in your http://www.zope.org/Documentation/Articles/ZODB1
>=20
> choice=3Draw_input("Press 'L' to list employees, 'A' to add"
>                                "an employee, or 'Q' to quit:")
> choice=3Dchoice.lower()
>=20
>=20
> I can't get that lower() thing to work. I tried for example:
>=20
> n =3D raw_input("Guess a number between 1 and 100")
> n.lower()
>=20
> but I just get
>=20
> AttributeError: 'string' object has no attribute 'lower'
>              =20
>=20
>=20
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>=20