これをどのように停止するのですか?while
ループ?どのように私はこれをループ中にループを停止するのですか
Sentence = input("Please enter the sentence: ").lower()
if "." in Sentence or "'" in Sentence or "," in Sentence or ";" in Sentence or ":" in Sentence or "/" in Sentence or "?" in Sentence or "!" in Sentence or "-" in Sentence:
while Sentence:
print("Your sentence is invalid. Please enter the sentence without punctuation")
else:
allWords = Sentence.split()
print(allWords)
FindWord = input("Enter the word you are looking for: ").lower()
for L in range(len(allWords)):
if FindWord == allWords[L]:
print("The word <", FindWord, "> is found in", L,"th positions")
よくある質問をしてください。http://stackoverflow.com/help/how-to-ask – Deadpool