What is wrong with my code?
Chris Rebert
clp2 at rebertia.com
Sun Oct 23 06:08:33 EDT 2011
More information about the Python-list mailing list
Sun Oct 23 06:08:33 EDT 2011
- Previous message (by thread): What is wrong with my code?
- Next message (by thread): What is wrong with my code?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sun, Oct 23, 2011 at 3:03 AM, apometron <apometron.listas.cinco at 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
- Previous message (by thread): What is wrong with my code?
- Next message (by thread): What is wrong with my code?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list