0

This is the game I am trying to build:

print "Hello! Welcome to LIGHT! Please choose a username to begin."
print "Username:",
username = raw_input() 
print "Very well! Nice to meet you, %s. Where would you like your journey to begin?" % username
print """
\t* (A) Goldnesse
\t* (B) Wildecrest
\t* (C) Foxview
\t* (D) Westwood
"""
place = raw_input("A, B, C, or D? ")

if place == "A" or "a": 
    print "Welcome to Goldnesse!"
else:
    pass

if place == "B" or "b":
    print "Welcome to Wildecrest!"
else:
    pass

if place == "C" or "c":
    print "Welcome to Foxview!"
else:
    pass

if place == "D" or "d":
    print "Welcome to Westwood!"
else:
    pass

Whenever I try to run it in Terminal, and type A, a, B, or b, etc, it prints all of the responses. Like this:

    A, B, C, or D? d
Welcome to Goldnesse!
Welcome to Wildecrest!
Welcome to Foxview!
Welcome to Westwood!

Id there something wrong with my code?! Thanks.

Kass D
  • 19
  • 5
  • ` or "a"` is always true, see the duplicate. Note that it is easier to use a dictionary mapping letter to place. `places = {'a': 'Goldnesse', 'b': 'Wildecrest', ...}` and `print places[place.lower()]`. – Martijn Pieters Apr 30 '16 at 13:04
  • BTW, in Python, `or` is an operator, not a function. – PM 2Ring Apr 30 '16 at 13:11

0 Answers0