How would one split line into an array of words and convert them to lowercase with Python? I am working with a TXT file. Below is my work thus far:
file_data = []
# ------------ Add your code below --------------
# We need to open the file
with open('/dsa/data/all_datasets/hamilton-federalist-548.txt', 'r') as file:
# For each line in file
for line in file:
line = line.strip()
split_line = line.split(' ')
file_data.append(split_line)
print(split_line)
# We want to split that line into an array of words and convert them to lowercase
# [x.lower() for x in ["A","B","C"]] this example code will covert that list of letters to lowercase
print(file_data.lower())