College Performance Task Plan
Sketch up of project
import random
Colors = {1: 'Blue', 2: 'Red', 3: 'Green', 4:'Black', 5:'White'}
answer = Colors[random.randrange(1, 6)]
print("You have 4 tries to guess the color!")
print("Options:")
for keys, value in Colors.items():
print(value)
print("-----------------------")
def guess():
userGuess = input("What color do you think it is?")
i = 0
while i < 4:
if userGuess == answer:
print(f"You Win! The color was {answer}")
break
else:
print(f"Wrong guess, its not {userGuess}")
userGuess = input("Wrong, new guess?")
i = i + 1
if i == 4:
print("Too many guesses you lose!")
guess()
import random
Colors = {1: 'Blue', 2: 'Red', 3: 'Green', 4:'Black', 5:'White'}
answer = Colors[random.randrange(1, 6)]
print("You have 4 tries to guess the color!")
print("Options:")
for keys, value in Colors.items():
print(value)
print("-----------------------")
def guess():
userGuess = input("What color do you think it is?")
i = 0
while i < 4:
if userGuess == answer:
print(f"You Win! The color was {answer}")
break
else:
print(f"Wrong guess, its not {userGuess}")
userGuess = input("Wrong, new guess?")
i = i + 1
if i == 4:
print("Too many guesses you lose!")
guess()
import random
print("Choose 5 random colors!")
color1 = str(input("Color 1?"))
color2 = str(input("Color 2?"))
color3 = str(input("Color 3?"))
color4 = str(input("Color 4?"))
color5 = str(input("Color 5?"))
Colors = {1: color1, 2: color2, 3: color3, 4: color4, 5: color5}
answer = Colors[random.randrange(1, 6)]
print("You have 4 tries to guess the color!")
print("Options:")
for keys, value in Colors.items():
print(value)
print("-----------------------")
def guess():
userGuess = input("What color do you think it is?")
i = 0
while i < 4:
if userGuess == answer:
print(f"You Win! The color was {answer}")
break
else:
print(f"Wrong guess, its not {userGuess}")
userGuess = input("Wrong, new guess?")
i = i + 1
if i == 4:
print("Too many guesses you lose!")
guess()