Creating a dictionary from a .txt file
Dave Angel
davea at davea.name
Sun Mar 31 13:31:36 EDT 2013
On 03/31/2013 12:52 PM, C.T. wrote:
> On Sunday, March 31, 2013 12:20:25 PM UTC-4, zipher wrote:
>> <SNIP>
>>
>
> Thank you, Mark! My problem is the data isn't consistently ordered. I can use slicing and indexing to put the year into a tuple, but because a car manufacturer could have two names (ie, Aston Martin) or a car model could have two names(ie, Iron Duke), its harder to use slicing and indexing for those two. I've added the following, but the output is still not what I need it to be.
>
>
So the correct answer is "it cannot be done," and an explanation.
Many times I've been given impossible conditions for a problem. And
invariably the correct solution is to press bac on the supplier of the
constraints.
Unless there are some invisible characters in that file, lie tabs in
between the fields, it loocs liec you're out of luc. Or you could
manually edit the file before running the program.
[The character after 'j' is broccen on this cceyboard.]
--
DaveA
More information about the Python-list
mailing list