<div>Apologies for all my questions. Up to this point I have been able to work out most of the challenges but I seem to have hit a wall. Can't seem to make any progress and completely frustrated.</div>
<div> </div>
<div>I looked at the 11/21 discussion. From the documentation, I realized I needed to set the variables to view the keys and values. Getting an error though.</div>
<div> </div>
<div>attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0}<br>MAX_POINTS = 30<br>keys = attributes.viewkeys()<br>values = attributes.viewvalues()</div>
<div> </div>
<div>Traceback (most recent call last):<br> File "C:\Users\Public\Documents\My Python programs\role_playing_game1.py", line 8, in <module><br> keys = attributes.viewkeys()<br>AttributeError: 'dict' object has no attribute 'viewkeys'</div>
<div> </div>
<div><br><br> </div>
<div class="gmail_quote">On Tue, Dec 7, 2010 at 3:44 AM, Alan Gauld <span dir="ltr"><<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="im"><br>"Al Stern" <<a href="mailto:albstern@gmail.com" target="_blank">albstern@gmail.com</a>> wrote<br><br></div>
<div class="im">
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0}<br>
MAX_POINTS = 30<br><br>How do I set the variable for available_points?<br><br>available_points = MAX_POINTS - (not sure what goes here)<br></blockquote><br></div>Check the mail from Robert Sjoblom, he gives you the necessary clues.<br>
You can check the archive a few weeks back(21st Nov) for his question<br>too and get some alternative options and discussion.
<div class="im"><br><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">attributes["strength"] = input("\nHow many points do you want to assign to<br>strength?: ")<br>
<br>Please let me know if this isn't advisable. It seems to work on the<br>surface.<br></blockquote><br></div>Close, but remember that input() returns a string. You need numbers<br>so you need to convert strings to integers.
<div>
<div></div>
<div class="h5"><br><br>HTH,<br><br><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><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>