When replying to the Python Tutor list, please use "Reply All" instead of just "Reply". I meant to put this in my previous message, but it remained in "meant to" phase and never got implemented properly. 8-)<br>
<br>
<blockquote style="MARGIN-RIGHT: 0px" dir="ltr">
<div class="gmail_quote">I don't think it's been initialized properly, but that's where I don't understand about the accumulator for strings. I originally thought this for the accumulator:</div>
<div class="gmail_quote"> </div>
<div class="gmail_quote">output=""</div>
<div class="gmail_quote">for i in range(len(message[i])" </div></blockquote>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<blockquote style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="im">
<blockquote style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div><br> print"The value of message[i] is ", message[i]<br></div> output=output+" " + ord(message[i])
<div><br> print"The value of the message is ", output<br><br></div>but strings and integers don't concatentate AND my ord(value) isn't accumulating AND I thing my output is getting overwritten. <br></blockquote>
</div>
<div class="gmail_quote">You don't want to mix apples and oranges. Your variable "message" contains a full name in the test case, "John X. Doe", for example, so it's made up of characters. What should the accumulator contain, if you're going to be adding numbers? <font color="#3333ff">Numbers</font></div>
</blockquote></blockquote>
<div class="gmail_quote"> </div>
<div class="gmail_quote">Then your code above should look something like this:</div>
<div class="gmail_quote"> </div>
<div class="gmail_quote">output= 0<br>for i in message:<br> print"Character i in message: ", message[i]<br> output=output + ord(message[i]) </div>
<div class="gmail_quote">print "The value of the message is ", output</div>
<div class="gmail_quote"><br> </div>
<div class="gmail_quote">In pseudocode:</div>
<div class="gmail_quote">Start with the value for an empty message in the variable "output".</div>
<div class="gmail_quote">For every character in "message":</div>
<div class="gmail_quote"> Print the character</div>
<div class="gmail_quote"> Add the ASCII value of the character to the accumulator "output".</div>
<div class="gmail_quote">After all of the characters have been processed, show the final value of "output"</div>
<div class="gmail_quote"> </div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="gmail_quote">
<blockquote style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="gmail_quote">
<div class="im">
<div>
<div> </div></div></div>
<div>Is this homework? <font color="#3333ff">Not anymore I'm past that and I live in NC and I've been desperately looking for a tutor but I'm having difficulty finding anyone who does Python programming. They don't teach it at NC State or UNC or Wake Tech. If you don't want to help. I understand. This was my last resort.</font> <br>
</div></div></blockquote>
<div>
<div></div>
<div class="h5">
<blockquote style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="gmail_quote">
<div> </div></div></blockquote></div></div></div></blockquote>
<div class="gmail_quote"> </div>
<div class="gmail_quote">Not at all. It's just that we have a rule about not doing anyone's homework on the list. It robs them of the learning experience, and can provide a grade which hasn't been earned properly.</div>
<div class="gmail_quote"> </div>
<div class="gmail_quote">Tony R.</div>
<div class="gmail_quote"> </div>