<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;">Hello, i am working on a project for learning python and I’m stuck.  The directions are confusing me.  Please keep in mind I’m very ne to this.  The directions are long so I’ll just add the paragraphs I’m confused about and my code if someone could help me out I’d greatly appreciate it!  Also, we haven’t learned loops yet so just conditional operators and for some reason we can’t use global variables.  <div><br></div><div><div><br></div><div><span style="font-size: 12px;">from random import randrange</span></div><div><span style="font-size: 12px;">randrange(1, 101)</span></div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;">from random import seed</span></div><div><span style="font-size: 12px;">seed(129)</span></div><div><span style="font-size: 12px;">    </span></div><div><span style="font-size: 12px;">def print_description():</span></div><div><span style="font-size: 12px;">    print """Welcome to Guess the Number.</span></div><div><span style="font-size: 12px;">    I have seleted a secret number in the range 1 ... 100.</span></div><div><span style="font-size: 12px;">    You must guess the number within 10 tries.</span></div><div><span style="font-size: 12px;">    I will tell you if you ar high or low, and</span></div><div><span style="font-size: 12px;">    I will tell you if you are hot or cold.\n"""</span></div><div><span style="font-size: 12px;">   </span></div><div><span style="font-size: 12px;">def get_guess(guess_number):</span></div><div><span style="font-size: 12px;">    print "(",guess_number,")""Plese enter a guess:"</span></div><div><span style="font-size: 12px;">    current_guess = raw_input()</span></div><div><span style="font-size: 12px;">    return int(guess_number)</span></div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;">def main():</span></div><div><span style="font-size: 12px;">    print_description()</span></div><div><span style="font-size: 12px;">    secret = 50</span></div><div><span style="font-size: 12px;">    current_guess = 1</span></div><div><span style="font-size: 12px;">    get_guess(1)</span></div><div><span style="font-size: 12px;">    if current_guess != secret():</span></div><div><span style="font-size: 12px;">        print "Congratulations you win!!"</span></div><div><span style="font-size: 12px;">   </span></div><div><span style="font-size: 12px;">main()</span></div><div><br></div><div><br></div><div>Here are the instructions I’m having a hard time with and just not sure I’m doing it correctly.  I’m not sure the get_guess function is correct and I’m a little lost with the secret and current_guess variable.</div></div><div><br></div><div><div class="page" title="Page 3"><div class="layoutArea"><div class="column"><ol start="3"><li style="font-size: 10pt; font-family: CMR10;"><p><span style="font-size: 10pt;">From within the body of the </span><span style="font-size: 10pt; font-family: CMTT10;">main </span><span style="font-size: 10pt;">function, immediately after the call to </span><span style="font-size: 10pt; font-family: CMTT10;">print description</span><span style="font-size: 10pt;">, create variable </span><span style="font-size: 10pt; font-family: CMTT10;">secret </span><span style="font-size: 10pt;">and assign it a random number between 1 and 100, generated using the </span><span style="font-size: 10pt; font-family: CMTT10;">randrange </span><span style="font-size: 10pt;">function. You will need to pass two argument to </span><span style="font-size: 10pt; font-family: CMTT10;">randrange</span><span style="font-size: 10pt;">, what do you think they should be? You should be able to use the python help system or online python documentation to make sure you understand the arguments to </span><span style="font-size: 10pt; font-family: CMTT10;">randrange</span><span style="font-size: 10pt;">.</span></p></li><li style="font-size: 10pt; font-family: CMR10;"><p><span style="font-size: 10pt;">After the end of the body of the </span><span style="font-size: 10pt; font-family: CMTT10;">print description </span><span style="font-size: 10pt;">function, define a new global function named </span><span style="font-size: 10pt; font-family: CMTT10;">get guess </span><span style="font-size: 10pt;">that takes a single parameter. Name the parameter </span><span style="font-size: 10pt; font-family: CMTT10;">guess number</span><span style="font-size: 10pt;">, because it will hold the index (1, 2, 3, ..., 10) of current guess attempt. Make the function ask the user to enter guess using the </span><span style="font-size: 10pt; font-family: CMTT10;">raw input </span><span style="font-size: 10pt;">function. The function will return the number entered by the user, after it has been converted to an integer.</span></p><p><span style="font-size: 10pt;">Return to the </span><span style="font-size: 10pt; font-family: CMTT10;">main </span><span style="font-size: 10pt;">function after the statement that assigned a value to the </span><span style="font-size: 10pt; font-family: CMTT10;">secret </span><span style="font-size: 10pt;">variable. In a new variable named </span><span style="font-size: 10pt; font-family: CMTT10;">current guess </span><span style="font-size: 10pt;">store the result of calling the </span><span style="font-size: 10pt; font-family: CMTT10;">get guess </span><span style="font-size: 10pt;">function with an argument of 1. Run your program to make sure it works correctly.</span></p></li></ol></div></div></div><div class="page" title="Page 4"><div class="layoutArea"><div class="column"><ol start="8"><li style="font-size: 10pt; font-family: CMR10;"><p><span style="font-size: 10pt;">At the end of the </span><span style="font-size: 10pt; font-family: CMTT10;">main </span><span style="font-size: 10pt;">function, check if the current guess matches the secret. If it matches, print ‘Congratulations, you win!’. If it does not, print ‘Please play again!’ </span></p><div><br></div><div><br></div><div><br></div><div><br></div><div>Thanks again!!!</div><div><br></div><div><br></div><br class="Apple-interchange-newline"></li></ol></div></div></div></div><div><br></div></body></html>