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. -- http://amitsaha.github.com/ _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor