New to Python. For in loops curiosity

Rustom Mody rustompmody at gmail.com
Tue May 13 23:48:13 EDT 2014


On Wednesday, May 14, 2014 9:08:32 AM UTC+5:30, Leonardo Petry wrote:
> 
> This is just too convenient. 
> 
> Basically my question is: Why is python not treating the contents of wordplay.txt as one long string and looping each character?

Did you mean convenient or inconvenient?

Anyways...

Maybe you want the read method?
https://docs.python.org/2/tutorial/inputoutput.html#methods-of-file-objects




More information about the Python-list mailing list