<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Mar 1, 2014, at 9:35 AM, Dennis Lee Bieber <<a href="mailto:wlfraed@ix.netcom.com">wlfraed@ix.netcom.com</a>> wrote:</div><blockquote type="cite"><div style="font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="Apple-tab-span" style="white-space: pre;">        </span>Without loops, one part of your assignment is going to be tedious,<br>unless the intent is to only allow for one guess per run.<br></div></blockquote><div>No, 10 guesses per game.  Yes very tedious and repetative.</div><blockquote type="cite"><div style="font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><blockquote type="cite">from random import randrange<br>randrange(1, 101)<br></blockquote><br><span class="Apple-tab-span" style="white-space: pre;">    </span>You generated a random number and then threw it away.<br><blockquote type="cite"><br>from random import seed<br>seed(129)<br></blockquote></div></blockquote>I do not know what seed is.  The directions in the begining said to do that I guess to test the code through out writing it?  This is what the directions for that part said.</div><div>
                
        
        
                <div class="page" title="Page 2">
                        <div class="layoutArea">
                                <div class="column">
                                        <ol>
                                                <li style="font-size: 10.000000pt; font-family: 'CMR10'"><p><span style="font-size: 10pt;">At the top of your file, import the </span><span style="font-size: 10.000000pt; font-family: 'CMTT10'">randrange </span><span style="font-size: 10pt;">function from the </span><span style="font-size: 10.000000pt; font-family: 'CMTT10'">random
</span><span style="font-size: 10pt;">module. </span><span style="font-size: 10pt; color: rgb(255, 0, 0);">In order to test this module I also want you to import the </span><span style="font-size: 10.000000pt; font-family: 'CMTT10'; color: rgb(100.000000%, 0.000000%, 0.000000%)">seed
</span><span style="font-size: 10pt; color: rgb(255, 0, 0);">function from the </span><span style="font-size: 10.000000pt; font-family: 'CMTT10'; color: rgb(100.000000%, 0.000000%, 0.000000%)">random </span><span style="font-size: 10pt; color: rgb(255, 0, 0);">module. Immediately after importing it I want </span><span style="font-size: 10pt; color: rgb(255, 0, 0);">you to call the seed function with an argument of 129. By calling the </span><span style="font-size: 10pt; font-family: CMTT10; color: rgb(255, 0, 0);">seed
</span><span style="font-size: 10pt; color: rgb(255, 0, 0);">function we ensure that the sequence of random numbers you generate will
exactly match the ones used in this document. </span></p></li></ol></div></div></div><blockquote type="cite"><div style="font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><span class="Apple-tab-span" style="white-space: pre;">       </span>Now you are seeding the random number generator but never generate a<br>new number after it.<br><br><blockquote type="cite"><br>def print_description():<br>  print """Welcome to Guess the Number.<br>  I have seleted a secret number in the range 1 ... 100.<br>  You must guess the number within 10 tries.<br>  I will tell you if you ar high or low, and<br>  I will tell you if you are hot or cold.\n"""<br><br>def get_guess(guess_number):<br>  print "(",guess_number,")""Plese enter a guess:"<br>  current_guess = raw_input()<br>  return int(guess_number)<br></blockquote><br><span class="Apple-tab-span" style="white-space: pre;"> </span>You're returning the counter of how many guesses have been made, and<br>dropping the player's guess into the trash<br></div></blockquote>I actually do not understand what you mean here.  Should I get rid of the current_guess line completely?  Should it look more like this;</div><div><br></div><div>def get_guess(guess_number):<br><span class="Apple-tab-span" style="white-space: pre;"> </span>raw_input(“Please enter a guess”)<br><span class="Apple-tab-span" style="white-space: pre;">       </span>guess_number = int(guess_number)<br><span class="Apple-tab-span" style="white-space: pre;">        </span>return (guess_number)<br>get_guess(1)<br><blockquote type="cite"><div style="font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><blockquote type="cite"><br>def main():<br>  print_description()<br>  secret = 50<br></blockquote><br><span class="Apple-tab-span" style="white-space: pre;">   </span>That's supposed to be the random number, isn't it?<br></div></blockquote>Yes it is, I put 50 there because I was going to try and test it.  I think it should be secret = randrange(1,101) right?<br><blockquote type="cite"><div style="font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><blockquote type="cite">  current_guess = 1<br>  get_guess(1)<br></blockquote><br><span class="Apple-tab-span" style="white-space: pre;">      </span>You drop the return value into the trash<br><br><blockquote type="cite">  if current_guess != secret():<br></blockquote><br><span class="Apple-tab-span" style="white-space: pre;">      </span>You are /calling/ a function called secret -- which doesn't exist,<br>since you bound it to the integer value 50; And current_guess doesn't exist<br>in this function either.<br><br><blockquote type="cite">      print "Congratulations you win!!"<br></blockquote><br><br><span class="Apple-tab-span" style="white-space: pre;">     </span>Read the documentation on how function calls and return values operate.<br>Hint: you need to do something with the returned value /at the point where<br>you call the function/.<br></div></blockquote><div>Hmm, ok I’ll try and find what I’m missing.</div><br><blockquote type="cite"><div style="font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><span class="Apple-tab-span" style="white-space: pre;">     </span>And -- as has been mentioned; these mistakes are better served in the<br>tutor list, as they would be mistakes in /any/ common programming language.<br>--<span class="Apple-converted-space"> </span><br><span class="Apple-tab-span" style="white-space: pre;">   </span></div></blockquote>Yes, I’m sorry I completely forgot.  I’ll repost there and go that route.  Thanks though!</div><div><br></div><div><br></div></body></html>