import os

myPath = "./"

files = os.listdir(myPath)

files.sort()

print(files)

textFiles = []

for myFile in files:
    print(myFile)
    fileParts = myFile.split(".")
    print(fileParts)
    if(len(fileParts) > 2):
        print(len(fileParts))
    filePartsLength = len(fileParts)
    if fileParts[filePartsLength-1] == "txt":
        print("Text file!")
        textFiles.append(myFile)


print("The text files are: ",textFiles)
