forked from LewisAndClark-CSD/First-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGuess_My_Number.py
More file actions
37 lines (28 loc) · 877 Bytes
/
Guess_My_Number.py
File metadata and controls
37 lines (28 loc) · 877 Bytes
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
# Program Name:
# Author:
# Date:
# Guess My Number
#
# The computer picks a random number between 1 and 100
# The player tries to guess it and the computer lets
# the player know if the guess is too high, too low
# or right on the money
import random
#Opening Remarks
print("\tWelcome to 'Guess My Number'!")
print("\nI'm thinking of a number between 1 and 100.")
print("Try to guess it in as few attempts as possible.\n")
# set the initial values
the_number = random.randint(1, 100)
guess = # Create the priming read here
tries = 1
# guessing loop
while guess != the_number:
#put the guessing game logic here
tries += 1
guess = #Create the following read here
print("You guessed it! The number was", the_number)
print("And it only took you", tries, "tries!\n")
#Program Closing
input("\n\nPress the enter key to exit.")
asdfasdfadsfasdf