EDIT: Thanks. I assumed sets were ordered since the output is almost in alphabetical order. But yes I want an ordered set.
def create_table(secret):
sec = set(secret)
alpha = set("abcdefghiklmnopqrstuvwxyz")
bet = alpha - sec
newSecret = secret & bet
print newSecret
OUTPUT: set(['A', 'C', 'B', 'E', 'D', 'G', 'F', 'I', 'H', 'K', 'M', 'L', 'O', 'N', 'Q', 'P', 'S', 'R', 'U', 'T', 'W', 'V', 'Y', 'X', 'Z'])
How do I create an ordered set?
Example: If I take the string "mathematics" and the string "abcdefghiklmnopqrstuvwxyz", essentially the new string should be "MATHEICSBDFGKLNOPQRUVWXYZ" (assuming i have the code to uppercase the string). There is no 'J' in this string so it isn't a typo.
I'm trying to take the unique characters from the variable 'secret' and unique characters from the variable 'alpha' and get ordered unique characters from both.