Re: like a "for loop" for a string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fredrik Lundh

    #1

    Re: like a "for loop" for a string

    Alexnb wrote:
    Ya just an example, to print the numbers 1-5
    Sorry, I still don't have the slightest idea what you expect the code to do.

    </F>
    >>But I am wondering is there a way to something like this:
    >>>
    >>funString = "string string string non-string non-string string"
    >>and
    >>for "string" in funString:
    >> print something
    >>>
    >>I know you can't do that; but, is there a way do do something similar
    >>that
    >>gets the same result?
    >>
    >you seem to have forgotten to specify the result. or did you mean that
    >the above should print 1-5?
Working...