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 < <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 > <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"
![](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_320,h_80/http://academicheroes.com/wp-content/uploads/2018/09/order_now.png)