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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -