Friday, February 28, 2014

Informational Text Program

In this program I’ve learned a new built-in command key: the ‘.split’ function. What it does is allow python to interpret strings, or a sequences of numbers without the commas. Any given input, for example; something like (1 5 4 16 45 454) will become interpreted as as a list where the whitespace in between each number become segments each individual number. Likewise, within a sentence, the .split command will interpret the sentence as part of a list of seperate strings (also separated by commas). One problem I remember having in this program is calculating the total amont of characters on the given input text. I had to deal of the issue of the program not counting whitespaces as part of the the actual length.

No comments:

Post a Comment