python - Is there any way to retrieve data from dictionary with a tuple? -
Say that there is a dictionary and a tupal, I use the toplal as the key to get the value from the dictionary To do and then to put in, the result is in another tube.
dic = {"b": "bad", "a": "alpha", "c": for example, the dictionary and tubal are below < Change "}
tup = (" a "," b "," c ") ,
and what else do I want Tupal:
("alpha", "bad", "change") , is there any way to do this?
More specific, what I try to implement is to get the
dic.values () result, which results in me wanting to be
Know about the collection. Order () function, but the function is not available in my situation.
You can do this:
result = [dc [ i] T for i) print tuple (result) ("alpha", "bad", "change")
Comments
Post a Comment