delete all keys except one in dictionary
delete all keys except one in dictionary Question: I have a dictionary lang = {‘ar’:’arabic’, ‘ur’:’urdu’,’en’:’english’} What I want to do is to delete all the keys except one key. Suppose I want to save only en here. How can I do it ? (pythonic solution) What I have tried: In [18]: for k in …
Total answers: 4