Question on Manipulating List and on Python
Laurent Claessens
moky.math at gmail.com
Thu Sep 29 12:39:51 EDT 2011
Le 29/09/2011 18:27, John Gordon a écrit :
> In<a6679459-fc57-4389-8d43-1e5ed960d85d at y18g2000yqy.googlegroups.com> Subhabrata Banerjee<subhagurgaon2011 at gmail.com> writes:
>
>> (i) I have a file of lists. Now, the first digit starts with a number
>> or index, like,
>
>> [001, "Obama", "USA", "President"]
>> [002 "Major", "UK", "PM"]
>> [003 "Singh", "INDIA", "PM"]
What about creating a dictionary ?
dic = {1:["Obama","USA","President"],2:[etc.]]
>> (ii) My second question is posted by one of my colleagues, what makes
>> Python so fast?
If your colleague is used to program inside Word macros, I guess the
answer ;) If he is used to program in C, I'm less sure.
It really depends on the context of the question.
Laurent
More information about the Python-list
mailing list