Guess a number Jump to navigationJump to search This a problem set for you to work through [1] This is a problem set. Some of these are easy, others are far more difficult. The purpose of these problems sets are to HELP YOU THINK THROUGH problems. The solution is at the bottom of this page, but please don't look at it until you have tried (and failed) at least three or four times. Contents 1 What is this problem set trying to do 2 The Problem 3 Some Python code to get you started 4 Take This Further 5 How you will be assessed 6 References 7A possible solution What is this problem set trying to do You have to think about conditionals and computational thinking here. You are also going to be incrementing variables.
The Problem Please write a simple game that randomly selects a number between 0 and 100. A player must guess the number. Your program should tell the player if their guess is higher or lower than the secret number. Your program must generate a random number between 0 and 100 and assign that random number to a variable. Your program must ask the player to guess a number Your program must compare the players guess and the secret number. The program should tell the player if their guess is higher or lower than the secret number Your program must tell the player if they have won Your program must ask the player if they want to play again
0 comments:
Post a Comment