trying to sort a user input list
<p>Im new at python.  Im creating a script that allows a user to input three names and then the code should print the names and then print them sorted (alphabetically).  I can get the code to return the sorted individual letters, but not the full names as strings.  I really want to run AS A LOOP!!!here is what i have so far</p>

<pre><code>print ('Enter three names, when done hit enter with a blank: ')

a = (raw_input('enter first name: ')) 
b = (raw_input('enter first name: '))
c = (raw_input('enter first name: ')) 

while not raw_input == "":
    print a + b + c
    break

srtd = a + b + c
name = srtd

for name in sorted(srtd):
    print name
</code></pre>

<p>you can use a list in python it has a good function called sort you can call it from list code
<br></p>

<pre><code>print ('Enter three names, when done hit enter with a blank: ')

a = (raw_input('enter first name: ')) 
b = (raw_input('enter first name: '))
c = (raw_input('enter first name: ')) 

my_list = [a,b,c]
my_list.sort()
print my_list
</code></pre>

<p>if you want to print without the brackets use loop hope this helpful </p>

python loops sorting