Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

pre class

Question

<pre class=”ql-syntax”><span class=”hljs-comment”>### Debug this simple game

program. The game should generate a random number between 0 and 100</span> <span class=”hljs-comment”>### when the user hits Enter. The user can stop the game by typing “Stop”.</span> <span class=”hljs-comment”>### A score over 50 should result in a win.</span> <span class=”hljs-keyword”>import</span> random roll == raw_input(<span class=”hljs-string”>”Press Enter to Spin the Wheel or Type “”Stop””!”</span>) <span class=”hljs-keyword”>while</span> roll == <span class=”hljs-string”>” “</span>: prize = random.randint(<span class=”hljs-number”>0</span>, <span class=”hljs-number”>100</span>) <span class=”hljs-keyword”>print</span> <span class=”hljs-string”>”You’re number is “</span> str(prize) <span class=”hljs-string”>”!”</span> <span class=”hljs-keyword”>if</span> prize &lt; <span class=”hljs-number”>50</span> <span class=”hljs-keyword”>print</span> <span class=”hljs-string”>”Sorry, you didn’t win. Try again”</span> <span class=”hljs-keyword”>if</span> prize &gt; <span class=”hljs-number”>50</span> <span class=”hljs-keyword”>print</span> <span class=”hljs-string”>”Congratulations! You’re a winner!”</span> roll = raw_input(<span class=”hljs-string”>”Press Enter to Spin the Wheel or type ‘stop’!”</span>) <span class=”hljs-keyword”>if</span> roll == <span class=”hljs-string”>”Stop”</span>: prnt <span class=”hljs-string”>”Thank you for playing”</span> <span class=”hljs-keyword”>else</span>: <span class=”hljs-keyword”>print</span> <span class=”hljs-string”>”Well, so long!”</span> </pre>

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"