How to iterate the input over a particular size?

joy99 subhakolkata1234 at gmail.com
Sun Dec 27 09:44:17 EST 2009


Dear Group,

I am encountering a small question.

Suppose, I write the following code,

input_string=raw_input("PRINT A STRING:")
string_to_word=input_string.split()
len_word_list=len(string_to_word)
if len_word_list>9:
             rest_words=string_to_word[9:]
             len_rest_word=len(rest_words)
             if len_rest_word>9:
                      remaining_words=rest_words[9:]


In this program, I am trying to extract first 9 words from an
indefinitely long string, until it reaches 0.
Am I writing it ok, or should I use while, or lambda?
If any one can suggest.

Hope you are enjoying a nice vacation of Merry Christmas. If any one
is bit free and may guide me up bit.

Wishing you a happy day ahead,
Best Regards,
Subhabrata.



More information about the Python-list mailing list