-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathguessing_game.py
37 lines (26 loc) · 1.29 KB
/
guessing_game.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
Python Web Development Techdegree
Project 1 - Number Guessing Game
--------------------------------
For this first project we will be using Workspaces.
NOTE: If you strongly prefer to work locally on your own computer, you can totally do that by clicking: File -> Download Workspace in the file menu after you fork the snapshot of this workspace.
"""
import random
def start_game():
"""Psuedo-code Hints
When the program starts, we want to:
------------------------------------
1. Display an intro/welcome message to the player.
2. Store a random number as the answer/solution.
3. Continuously prompt the player for a guess.
a. If the guess greater than the solution, display to the player "It's lower".
b. If the guess is less than the solution, display to the player "It's higher".
4. Once the guess is correct, stop looping, inform the user they "Got it"
and show how many attempts it took them to get the correct number.
5. Let the player know the game is ending, or something that indicates the game is over.
( You can add more features/enhancements if you'd like to. )
"""
# write your code inside this function.
if __name__ == '__main__':
# Kick off the program by calling the start_game function.
start_game()