You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
colors = ["purple", "orange", "green"]
guess = input("Guess a color:")
if guess in colors:
print("You guessed correctly!")
else:
print("Wrong! Try again.")
I then run the code and try guessing white to see my message for when it is wrong (although this is also happening when I guess a color that is in the list) I get the following error message:
Traceback (most recent call last):
File "", line 2, in
File "", line 1, in
NameError: name 'white' is not defined
Am I doing something wrong? I typed it in just as it is written in the book.
The text was updated successfully, but these errors were encountered:
On Wed, Jan 2, 2019 at 10:01 AM ON227 ***@***.***> wrote:
When I try using this code from the book:
colors = ["purple", "orange", "green"]
guess = input("Guess a color:")
if guess in colors:
print("You guessed correctly!")
else:
print("Wrong! Try again.")
I then run the code and try guessing *white* to see my message for when
it is wrong (although this is also happening when I guess a color that
*is* in the list) I get the following error message:
Traceback (most recent call last):
File "", line 2, in
File "", line 1, in
NameError: name 'white' is not defined
Am I doing something wrong? I typed it in just as it is written in the
book.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#22>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AID8zwseNcFtuZZZAEAiC3btYlY5uhNHks5u_PQBgaJpZM4ZnAa_>
.
When I try using this code from the book:
colors = ["purple", "orange", "green"]
guess = input("Guess a color:")
if guess in colors:
print("You guessed correctly!")
else:
print("Wrong! Try again.")
I then run the code and try guessing white to see my message for when it is wrong (although this is also happening when I guess a color that is in the list) I get the following error message:
Traceback (most recent call last):
File "", line 2, in
File "", line 1, in
NameError: name 'white' is not defined
Am I doing something wrong? I typed it in just as it is written in the book.
The text was updated successfully, but these errors were encountered: