. , , , , x == "" x == "", -, .
It is clear that x cannot have two values, therefore AND will never be evaluated as true. This would be the correct code (or version of cyciraptors using an array)
x=raw_input("Please enter name: ")
if x=="David" or x=="Jonathon":
print "Whatever"
Given the discussion, here's the whole hog using a simple configuration file (I tested conf.read (). Split (), so please, no comments on this). The configuration file will contain one name for each line without spaces (so there is no "last name last name"):
conf = open('/path/to/config.txt','r')
names = conf.read().split()
x=raw_input("Please enter name: ")
if x in names:
print "Whatever"
If your list of names could become very long, this would be the most convenient solution.
source
share