Dictionary help

kjakupak at gmail.com kjakupak at gmail.com
Tue Feb 18 13:30:34 EST 2014


So let's say I have a file and it looks like this:
Title 1: item 
Title 2: item 
etc

Is it possible to use a dictionary for something like the input above? Because I want to be able to use the input above to delete the "Title 1" and "Title 2" but still show the items (on separate lines).
Basically I want it to just show:
item
item 
etc..

What I've got is 
dict(item.split(":") for item in cInfo.split(" "))

Where cInfo is a function that extracts the first 5 lines of a file



More information about the Python-list mailing list