On 10/23/2011 03:08 AM, Chris Rebert wrote:
On Sun, Oct 23, 2011 at 3:03 AM, apometron
<apometron.listas.ci...@gmail.com>  wrote:
import os
nome = sys.argv[1]
You did not `import sys`, so you'll get a NameError there.

final = nome
for i in nome:
    print i
    if nome[i] = "_":
        final[i] = " "
Strings aren't mutable in Python; you can't assign to slices of them.
So you'll get a TypeError on the previous line.

Cheers,
Chris

Also, the statement
    for i in nome:
does not loop through indices, but rather it loops through the actual characters of the string.

Gary Herron

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to