Adding/Removing Colors to Lists
import socket # imports the socket module 



The comment is completely pointless. But I cannot help it, my eyes naturally read it, my brain processes it, only to realize it says nothing new. Let your code speak for itself, avoid comments as much possible.


print '\nThis program is being run by', usr, 'on machine name', sname



Maybe it's somewhat more readable if you use standard Python formatting like this instead:

print '\nThis program is being run by %s on machine name %s' % (usr, sname)



runagain = 'y'



Instead of setting this to a string, and later using == 'y' to evaluate, it would be better to use proper booleans for this kind of thing. For example:

Similarly, instead of:


clradd = raw_input('\nWould you like to add any colors to the list? y or n\n')

while clradd == 'y':



You could write like this:

clradd = raw_input('\nWould you like to add any colors to the list? y or n\n') == 'y'

while clradd == 'y':


Try-catch block writing style:

try:
    removecolor = raw_input('\nWhat colors would you like to remove? ').title()
    templist.remove(removecolor)
except ValueError:
    print 'Looks like that color was not in the list, try again.'
    continue    


It's better to keep the try block as small as possible. For example, the removecolor assignment should be moved out from it. Also, since you simply want to check if the given color is in the list of colors, it would be cleaner to write that exactly:

removecolor = raw_input('\nWhat colors would you like to remove? ').title()
if removecolor in templist:
    templist.remove(removecolor)
else:
    print 'Looks like that color was not in the list, try again.'
    continue


There are couple of other things too, globally:


Incorrectly indented code
Incorrectly using while instead of a simple if
Duplicated code blocks
sys.exit is a bit harsh way to exit, try to avoid if possible


Suggested implementation

Putting the above suggestions together:

import socket

usr = raw_input('What is your name?\n').title()
sname = socket.gethostname()
print '\nThis program is being run by %s on machine name %s' % (usr, sname)

mylist = ['Red', 'White', 'Blue', 'Yellow', 'Green', 'Orange']
templist = list(mylist)
runagain = True

while runagain:
    print '\nThe current colors are:', templist

    clradd = raw_input('\nWould you like to add any colors to the list? y or n\n') == 'y'

    if clradd:
        colors = raw_input('\nWhat colors would you like to add to the list? Please type one color. \n').title()
        templist.append(colors)

        print templist
        print '\nAscending and Descending'
        print '-' * 30
        print '\nAscending (high to low): ', sorted(templist, reverse=True)
        print '\nDescending (low to high): ', sorted(templist, reverse=False)

    clrdel = raw_input('\nWould you like to remove any colors from the list? y or n\n') == 'y'

    while clrdel:
        removecolor = raw_input('\nWhat colors would you like to remove? ').title()
        if removecolor in templist:
            templist.remove(removecolor)
        else:
            print 'Looks like that color was not in the list, try again.'
            continue

        print 'Updated list\n', templist
        break

    runagain = raw_input('\nWould you like to run this program again again? y or n\n') == 'y'