Liam839

Sufficiently Lethal Scout
Contributor
does anyone know how to change a word in a list like this:

['then', 'he', 'walked', 'the', 'dog']

so im trying to change the word dog with lets say wolf. does anyone know how to do this without using the .replace() command?

also its python 2.6.5
 
So if the array is called "foo" and you want to change 'then' to 'there'

foo[0] = 'there'

replace is a lot more versatile though because you can choose whether or not to replace a certain number of occurrences
 
I mean languages.
VB is a language. In fact, I probably code more VBA than anything else. Gotta keep those Excel books running. .NET is a great step up because I can actually do things like Try..Catch

Also that code would work for most languages since arrays are done mostly in the same basic syntax. Except VB hilariously because it uses parentheses instead of brackets.
 
I've always wanted to learn how to code, one one of my smartest friends is a genius at it and he just makes it look even more interesting :(
 
I've always wanted to learn how to code, one one of my smartest friends is a genius at it and he just makes it look even more interesting :(
Then I guess you're only seeing the 20% creating part, not the 80% debugging part. Many hairs are lost.
 
Also don't forget that you need to know calculus to know coding.

Calculus is complicated.
Calculus isn't complicated at all. Well some parts are, but you could be a programmer your whole life and never touch it. Since I've been out of school I've used 0% calculus. All that really matters is you have a basic understanding of algebra, some statistics, and maybe some trig/geometry. Not really even for a job, but just a basic understanding of the world around you and when you see a report about something you understand what the numbers mean.

Also, 99% of the time you're touching calc outside class you're just using derivitives, which is a very basic concept.
 
see you guys took the other side of comp sci.... i looked at coding and ran away scared like a little girl but you give me a box to work on and then let me setup a network with users databases and routers and im a happy little camper
 
see you guys took the other side of comp sci.... i looked at coding and ran away scared like a little girl but you give me a box to work on and then let me setup a network with users databases and routers and im a happy little camper
Programmer is a lot different from a sysadmin. You can be both without a CS degree. Hell I got an MIS, I took a friggen COBOL course! So much mindfuck in that language.
 
Programmer is a lot different from a sysadmin. You can be both without a CS degree. Hell I got an MIS, I took a friggen COBOL course! So much mindfuck in that language.
it takes a special person to want to do both