When the user is asked to search for a word, I want it to be case-insensitive.
import string
usersentence= input("Please type in a sentence without punctuation: ")
usersentence = ''.join(ch for ch in usersentence if ch not in set(string.punctuation))
print (usersentence.upper())
for i in range(1): # number of words you wont to search
word= input("Please enter a word you want to search for in the sentence: ")
words = usersentence.split(' ')
passed = False # Something to check if the word is found
for (i, words) in enumerate(words):
if (words == word):
print("your word appears in position(s): ")
print(i+1)
passed = True # The word has been found
if not passed:
print("Sorry your word does not seem to be here")