我遇到了问题,其中包括Python中while
循环的多个语句。它适用于单个条件,但是当我包含多个条件时,循环不会终止。我在这里做错了什么?python中的while循环的多个条件
name = raw_input("Please enter a word in the sentence (enter . ! or ? to end.)")
final = list()
while (name != ".") or (name != "!") or (name != "?"):
final.append(name)
print "...currently:", " ".join(final)
name = raw_input("Please enter a word in the sentence (enter . ! or ? to end.)")
print " ".join(final)
是我的错。感谢您的帮助,虽然...工作很好 – upendra 2014-10-26 21:43:50