<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Okay, I understand now. Thanks!<br>
<br>
Ken<br>
</tt><br>
Steve Willoughby wrote:
<blockquote cite="mid:20100311154609.GA65473@dragon.alchemy.com"
type="cite">
<pre wrap="">On Thu, Mar 11, 2010 at 10:32:45AM -0500, Ken G. wrote:
</pre>
<blockquote type="cite">
<pre wrap=""> list = ['physics', 'chemistry', 1997, 2000]
</pre>
</blockquote>
<pre wrap=""><!---->
This is a list of 4 elements, and lists allow elements to
be changed, so
</pre>
<blockquote type="cite">
<pre wrap=""> list[2] = 2010
</pre>
</blockquote>
<pre wrap=""><!---->
Will change the value of list to be ['physics','chemistry',1997,2010]
</pre>
<blockquote type="cite">
<pre wrap=""> line = [2010020820841134]
</pre>
</blockquote>
<pre wrap=""><!---->
Is this one right, or did you mean '2010020820841134'? What is shown is
a list of one element. Assuming you meant it to be a string, that would
give the error you quote below.
Strings are immutable objects, meaning that once they are created you can't
change them, although you can construct new strings from them, so if you
wanted to make a string which had characters 9 and 10 replaced with "08"
you could say:
line = line[:9]+"08"+line[11:]
</pre>
</blockquote>
</body>
</html>