<div>Ok.  I think I am starting to get it but still not sure how to separate the value from the key.  Once I have this...</div>
<div> </div>
<div>attributes = {&quot;strength&quot;: 0, &quot;health&quot;: 0, &quot;wisdom&quot;: 0, &quot;dexterity&quot;: 0}<br>MAX_POINTS = 30</div>
<div> </div>
<div>How do I set the variable for available_points?</div>
<div> </div>
<div>available_points = MAX_POINTS - (not sure what goes here)</div>
<div> </div>
<div>I am pretty sure I will change the values by something like this...</div>
<div> </div>
<div>attributes[&quot;strength&quot;] = input(&quot;\nHow many points do you want to assign to strength?: &quot;)</div>
<div> </div>
<div>Please let me know if this isn&#39;t advisable.  It seems to work on the surface.<br><br></div>
<div class="gmail_quote">On Mon, Dec 6, 2010 at 1:16 PM, Alan Gauld <span dir="ltr">&lt;<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><br>&quot;Al Stern&quot; &lt;<a href="mailto:albstern@gmail.com" target="_blank">albstern@gmail.com</a>&gt; wrote 
<div class="im"><br><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Thanks for the advice.  I think I have the dictionary function set up right<br>now although I&#39;m still not clear why it is better than the list.<br>
<br>attributes = {&quot;strength&quot;: 0, &quot;health&quot;: 0, &quot;wisdom&quot;: 0, &quot;dexterity&quot;: 0}<br></blockquote><br></div>Consider where you want to update the points for &quot;health&quot;<br><br>Using two lists you need to loop over the keys list to find the index<br>
of &quot;health&quot; then access the values list to set the points. Something<br>like this:<br><br>for x in range(len(keys)):<br>  if keys[x] == &quot;health&quot;:<br>      values[x] = newValue<br><br>With a dictionary you just need to do<br>
<br>attributes[&quot;health&quot;] = newValue<br><br>That&#39;s a lot less typing and will be faster performance too.<br>I&#39;d also say its a lot easier to see whats happening - its more readable.<br><br>HTH,<br><font color="#888888"><br>
-- <br>Alan Gauld<br>Author of the Learn to Program web site<br><a href="http://www.alan-g.me.uk/" target="_blank">http://www.alan-g.me.uk/</a></font> 
<div>
<div></div>
<div class="h5"><br><br><br><br>_______________________________________________<br>Tutor maillist  -  <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br></div></div></blockquote></div><br>