I'm currently learning python from on Edx 'Python for the absolute beginner. i am to Create a program that inputs a phrase (like a famous quotation) and prints all of the words that start with h-z, i keep getting an error message on line, Here's the code,can someone please help out with a correction.
quote= input("enter a 1 sentence quote, non-alpha separate words:")
word=""
for char in quote:
if char.isalpha() == True:
word += char.upper()
else:
if word[0].lower() >= "h":
print(word.upper())
word=""
else:
word=""
word?wordis an empty string and does not haveword[0].word. So if the first character is not alpha, you get this error.