Google Answers Logo
View Question
Q: Reading a files contents - Python ( No Answer,   1 Comment )
Subject: Reading a files contents - Python
Category: Computers > Algorithms
Asked by: macca1111-ga
List Price: $10.00
Posted: 22 Oct 2006 17:47 PDT
Expires: 21 Nov 2006 16:47 PST
Question ID: 775915

I have a file called aaa.txt

1 a
2 a
3 b

I need to grab each line "1 a" and if the second character is equal to
'a' then print 1 Apple.  If the second character equals b then print 3
There is no answer at this time.

Subject: Re: Reading a files contents - Python
From: cuu508-ga on 27 Oct 2006 15:59 PDT
looks like homework..

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  

Google Home - Answers FAQ - Terms of Service - Privacy Policy