wordList = []
longWords = []
reverseList = []


def userInput():
    global integer
    for i in range(3):
        wordList.append(input("Please enter word #" +str(i+1)))
    integer = int(input("Please enter the maximum amount of characters each word can be."))
    filter_long_words()
    
def filter_long_words():
    global integer
    for item in wordList:
        if len(item) > integer:
            longWords.append(item)
    
userInput()                    
def palindrome():
    for item in longWords:
        reverse = ""
        for letter in range(len(item)-1, -1, -1): #range(start, stop, sequence)
            reverse += item[letter].upper()
        reverseList.append(reverse)
    with open("Output.txt", "w") as text_file:
        for i in range(len(reverseList)):
            if i == len(reverseList)-1:
                text_file.write(str(reverseList[i]))
            else:    
                text_file.write(str(reverseList[i] + ", "))

palindrome()
da3bf04896d09011296e1efc71d591830efd7ee7
<mask token>


def userInput():
    global integer
    for i in range(3):
        wordList.append(input('Please enter word #' + str(i + 1)))
    integer = int(input(
        'Please enter the maximum amount of characters each word can be.'))
    filter_long_words()


<mask token>


def palindrome():
    for item in longWords:
        reverse = ''
        for letter in range(len(item) - 1, -1, -1):
            reverse += item[letter].upper()
        reverseList.append(reverse)
    with open('Output.txt', 'w') as text_file:
        for i in range(len(reverseList)):
            if i == len(reverseList) - 1:
                text_file.write(str(reverseList[i]))
            else:
                text_file.write(str(reverseList[i] + ', '))


<mask token>

<mask token>


def userInput():
    global integer
    for i in range(3):
        wordList.append(input('Please enter word #' + str(i + 1)))
    integer = int(input(
        'Please enter the maximum amount of characters each word can be.'))
    filter_long_words()


def filter_long_words():
    global integer
    for item in wordList:
        if len(item) > integer:
            longWords.append(item)


<mask token>


def palindrome():
    for item in longWords:
        reverse = ''
        for letter in range(len(item) - 1, -1, -1):
            reverse += item[letter].upper()
        reverseList.append(reverse)
    with open('Output.txt', 'w') as text_file:
        for i in range(len(reverseList)):
            if i == len(reverseList) - 1:
                text_file.write(str(reverseList[i]))
            else:
                text_file.write(str(reverseList[i] + ', '))


<mask token>

<mask token>


def userInput():
    global integer
    for i in range(3):
        wordList.append(input('Please enter word #' + str(i + 1)))
    integer = int(input(
        'Please enter the maximum amount of characters each word can be.'))
    filter_long_words()


def filter_long_words():
    global integer
    for item in wordList:
        if len(item) > integer:
            longWords.append(item)


userInput()


def palindrome():
    for item in longWords:
        reverse = ''
        for letter in range(len(item) - 1, -1, -1):
            reverse += item[letter].upper()
        reverseList.append(reverse)
    with open('Output.txt', 'w') as text_file:
        for i in range(len(reverseList)):
            if i == len(reverseList) - 1:
                text_file.write(str(reverseList[i]))
            else:
                text_file.write(str(reverseList[i] + ', '))


palindrome()

wordList = []
longWords = []
reverseList = []


def userInput():
    global integer
    for i in range(3):
        wordList.append(input('Please enter word #' + str(i + 1)))
    integer = int(input(
        'Please enter the maximum amount of characters each word can be.'))
    filter_long_words()


def filter_long_words():
    global integer
    for item in wordList:
        if len(item) > integer:
            longWords.append(item)


userInput()


def palindrome():
    for item in longWords:
        reverse = ''
        for letter in range(len(item) - 1, -1, -1):
            reverse += item[letter].upper()
        reverseList.append(reverse)
    with open('Output.txt', 'w') as text_file:
        for i in range(len(reverseList)):
            if i == len(reverseList) - 1:
                text_file.write(str(reverseList[i]))
            else:
                text_file.write(str(reverseList[i] + ', '))


palindrome()

wordList = []
longWords = []
reverseList = []


def userInput():
    global integer
    for i in range(3):
        wordList.append(input("Please enter word #" +str(i+1)))
    integer = int(input("Please enter the maximum amount of characters each word can be."))
    filter_long_words()
    
def filter_long_words():
    global integer
    for item in wordList:
        if len(item) > integer:
            longWords.append(item)
    
userInput()                    
def palindrome():
    for item in longWords:
        reverse = ""
        for letter in range(len(item)-1, -1, -1): #range(start, stop, sequence)
            reverse += item[letter].upper()
        reverseList.append(reverse)
    with open("Output.txt", "w") as text_file:
        for i in range(len(reverseList)):
            if i == len(reverseList)-1:
                text_file.write(str(reverseList[i]))
            else:    
                text_file.write(str(reverseList[i] + ", "))

palindrome()