011 11:51 AM
> To: python-l...@python.org
> Subject: Re: Question on Manipulating List and on Python
>
> On Fri, Sep 30, 2011 at 2:36 AM, Subhabrata Banerjee
> wrote:
> > And Python seems faster than C++/Java. It is indeed. I also experience
> > it.
>
>
-Original Message-
From: python-list-bounces+ramit.prasad=jpmorgan@python.org
[mailto:python-list-bounces+ramit.prasad=jpmorgan@python.org] On Behalf Of
Chris Angelico
Sent: Thursday, September 29, 2011 11:51 AM
To: python-list@python.org
Subject: Re: Question on Manipulating
In <71c71a9d-928d-4ebe-af64-674c31bc1...@e9g2000vby.googlegroups.com>
Subhabrata Banerjee writes:
> Hi John,
> The actual code is till now is:
> def name_debugger(n):
> open_file=3Dopen("/python27/name1.txt")
> for line in open_file:
> line_word=3Dline.split()
> #print l
On Fri, Sep 30, 2011 at 2:36 AM, Subhabrata Banerjee
wrote:
> And Python seems faster than C++/Java. It is indeed. I also experience
> it.
>
Python compared to Java? Difficult to compare. Python to C++?
Impossible to compare. But performance depends MASSIVELY on
algorithmic quality; if you code t
> word1=line_word[0]
> if word1==001:
You are comparing a string and an integer assuming you are reading a
text file.
integers
word1=int(line_word[0])
if word1=1:
strings
word1=line_word[0]
if word1=="001:"
--
http://mail.python.org/mailman/listinfo/python-list
Le 29/09/2011 18:27, John Gordon a écrit :
In Subhabrata
Banerjee 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 dictiona
On Sep 29, 9:27 pm, John Gordon wrote:
> In
> Subhabrata Banerjee 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"]
> > Initially, I am r
On Thu, Sep 29, 2011 at 9:11 AM, Subhabrata Banerjee
wrote:
> Dear Group,
>
> I have two questions one on list manipulation and other on Python.
>
> (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",
In
Subhabrata Banerjee 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"]
> Initially, I am reading the file and taking as
> for line in file:
>