Learning Goal: I’m working on a cyber security project and need a sample draft to help me learn.
About this Assignment
Knowing how to write, compile and execute code is a skill you’ll need throughout your professional career. In this course, you’ve learned how to create software programs using standard coding structures and processes such as variables, constants, operators, decision logic, arrays, iteration constructs, and functions. For this assignment, you will write an application using the Python programming language. Write a program that uses the random module to play Guess the Number game. The program should consist of three functions. The first will display the Title and program specifications. The second plays the game. The main function calls those functions as it controls the playing of the game. The Python program should be developed in three steps and each step builds off the code from the previous step, which is listed below. Note: be sure to leave comments in your code that explain the intention of your functions.
Prompt
Create a Python project in IDLE and begin the Project Program by developing a Python Function called display title() to display the title and programming specifications for the project.
Expand the Project Program and create a function called play game() that uses the randint() function that gets the number that the player has to guess. It then returns a random number between 1 and 10. Use a while statement so the user can guess the number until the guess is correct. If the users guess is lower than the random number then display the message ‘Too low’. If the user guess is higher than the random number then display the message ‘Too high’. If the user guess matches the random number display the message, ‘You guessed it ‘. Then, a return statement returns to the statement in the main() function that is after the call to the play game() function.
Expand the Project Program and create main() function to the function call statements. Call the display title() function. Then define a variable that will hold the value of yes. Create a loop that will check the variable, while the variable equals yes then call the play game function. Then allow the user to input if they want to play again. If yes, play again, if no end the program.
please attach the assignment as a Python file (.py). Do NOT submit assignment as a PDF.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more
Recent Comments