On 21/03/2013 13:54, Amit Saha wrote:
On Thu, Mar 21, 2013 at 11:43 PM, Shall, Sydney <sydney.sh...@kcl.ac.uk> wrote:
I have an elementary question provoked by another post today.

1. Is it the case that ALL imported data from a file is a string?
2. Does this therefor imply that said data has to be processed appropriately
to generate the data in the form required by the program?
To the best of my knowledge, yes to both of your queries. Once you
have the element you want to process, you can make use of the type
converting functions (int(), float().. ) and use them appropriately.

3. Are there defined procedures for doing the required processing?
If you meant conversion functions, int() and float() are examples of
those. You of course  (most of the times) have to make use of string
manipulation functions (strip(), rstrip(), etc) to extract the exact
data item you might be looking for. So, they would be the building
blocks for your processing functions.

I hope that makes some things clear.

-Amit.

Yes, Thanks. This is now quite clear.
Sydney

--
Professor Sydney Shall,
Department of Haematological Medicine,
King's College London,
Medical School,
123 Coldharbour Lane,
LONDON SE5 9NU,
Tel & Fax: +44 (0)207 848 5902,
E-Mail: sydney.shall,
[correspondents outside the College should add; @kcl.ac.uk]
www.kcl.ac.uk

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to