Python Syntax

Discuss all aspects of programming here.

Moderator: The Mod Squad

Python Syntax

Postby Dr.Robotnik » Tue Dec 07, 2010 8:49 am

I'm new to python and I have a simple syntax question. It is so simple I don't even know what to type into google. Here is what I'm trying to do in c++...

Code: Select all
char array[] = "hello";

array[3] = 'z';


how would I do this in python?

I tried this

Code: Select all
string = "hello"

string[3] = 'z'


but it doesn't work.

also i'm using python24
Dr.Robotnik
Pilgrim
Pilgrim
 
Posts: 13
Joined: Sun Jun 13, 2010 8:10 pm

Postby evasive » Thu Dec 09, 2010 5:09 am

We hate rut, but we fear change.
********************************
System error, strike any user to continue...
evasive
Mobo-fu Master
Mobo-fu Master
 
Posts: 36791
Joined: Sun May 06, 2001 12:01 am
Location: Netherlands

Postby Dr.Robotnik » Thu Dec 09, 2010 9:17 am

Thanks a lot.

That is so weird, you have to create a new string. I don't like python24, i am taking a programming course half in python half in java, I can't wait to get to java... At least now i can make the library work off a flash drive though.
Dr.Robotnik
Pilgrim
Pilgrim
 
Posts: 13
Joined: Sun Jun 13, 2010 8:10 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests