By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,071 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

(No subject)

P: n/a

Hi
I'm brand new to python and I was wondering if anybody knew of a easy way to change every character in a list into its lower case form.

The list is like so:
commands = ['CLASS-MAP MATCH-ALL cmap1', 'MaTch Ip AnY', 'CLASS-map Match-Any cmap2', 'MaTch AnY', 'Policy-map policy1', 'Class cmap1', 'policy-Map policy2', 'Service-PoLicy policy1', 'claSS cmap2']

and what I want is:
commands = ['class-map match-all cmap1', 'match ip any', 'class-map match-any cmap2', 'match any', 'policy-map policy1', 'class cmap1', 'policy-map policy2', 'service-policy policy1', 'class cmap2']

Are there any defined method within any known modules to do this in one go?

Thanks in advance


__________________________________________________ _______________
Sign up for eircom broadband now and get a free two month trial.*
Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Helpful subjects help....

commands = [c.lower() for c in commands]

--
Regards,

Diez B. Roggisch
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.