For example I have my dictionary: my_dict = {'2':'even','1':'odd','3':'odd'} And this is my database:
+---------+--------+
| Numeric | String |
+---------+--------+
| 5 | five |
| 4 | four |
| 3 | three |
| 2 | two |
| 1 | one |
+---------+--------+
In my_dict dictionary,using their keys, I want to get their String value in my database (SQL SERVER) and using their values, sort their String value in this sequence:
odd - even - odd to be liked this
one two three.
And print the output like this: Let's count one two three. Actually I just based from Jisoo's question Querying a list of tuples in Database coz we're quite similar but in mine, is about dictionary.
('even', 'odd', 'odd')has no total order, i.e. the order would be ambiguous the way I read it.Stringvalues of thekeysto be like thistwo is divisible by 2, one is not divisible by 2, three is not divisible by 2.