Q:

How do I create an array of strings through user inputs and print them lexicographically in Python?

I am trying to create a small program that prompts the user to input 3 words, then put the string inputs into an array, then sort the array lexicographically and print the array as a string list.
I have tried the .sort function which does not work. The project I am working on does not require knowledge of loops (which I do not have a lot of experience with yet).
    a = []
    first = input("Type a word: ")
    second = input("Type another word: ")
    third = input("Type the last word: ")
    a += first
    a += second
    a += third

    a = sorted(a)

    print(a)

I want the printed results to be the 3 words together separated by commas
 Apple, Banana, Egg

Instead, my code prints
 ['A', 'B', 'E', 'a', 'a', 'a', 'e', 'g', 'g', 'l', 'n', 'n', 'p', 'p']

A:

The problem is that += on a list is the concatenation of two lists.. and so python interprets your string "Apple" as the (unpacked) list ['A', 'p', 'p', 'l', 'e'] .
Two different solutions:
1) Make the inputs a single list with the word:
a = []
first = input("Type a word: ")
second = input("Type another word: ")
third = input("Type the last word: ")
a += [first]
a += [second]
a += [third]

a = sorted(a)

print(a)

or 
2) simply use the append method, which expects a single element.
a = []
first = input("Type a word: ")
second = input("Type another word: ")
third = input("Type the last word: ")
a.append(first)
a.append(second)
a.append(third)

a = sorted(a)

print(a)

