I got a text file with 850 lines of different questions about a topic.
All are written in lowercase.
My final goal is to have a text file, where everything is written in uppercase except the stopwords AND words the Questions start with.
For now, I just don't know how I can convert the found words into lowercase
# List of Stopwords
import os
import codecs
# open working directory
stopwords = open("C:\\Python Project\\Headings Generator\\stopwords.txt", "r" ,encoding='utf8',errors="ignore")
stopwordsList = [(line.strip()).title() for line in stopwords]
questions = open("C:\\Python Project\\Headings Generator\\questionslist.txt", "r" ,encoding='utf8',errors="ignore")
questionsList = [(line.strip()).title().split() for line in questions]
for sentences in questionsList:
for words in sentences:
if words in stopwordsList:
#How to replace the found word with a lowercase version of it?
Thank you very much!