like a "for loop" for a string

Alexnb alexnbryan at gmail.com
Sun Aug 17 20:31:24 CEST 2008


Ya just an example, to print the numbers 1-5


Fredrik Lundh wrote:
> 
> Alexnb wrote:
> 
>> 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?
> 
> </F>
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
> 
> 

-- 
View this message in context: http://www.nabble.com/like-a-%22for-loop%22-for-a-string-tp19022098p19022155.html
Sent from the Python - python-list mailing list archive at Nabble.com.




More information about the Python-list mailing list