[Tutor] How to print certain elements

Adriansanchez asanch505 at hotmail.com
Tue Jan 21 07:18:21 CET 2014


Hello everyone,
I am newbie to Python and programming in general. My question is, given a list:
X=['washington','adams','jefferson','madison','monroe']
And a string:
Y='washington,adams,jefferson,madison,monroe'

How would I print washington and monroe using   [:]?
How would I print every element but those two names?
Thanks community!
-A-


More information about the Tutor mailing list