inverse tag

1 questions


1 answers
131 views
0
To reverse the key-value of a dict

Dict ismap = { 'a': 1, 'b':2 }Flip the key-value when present. inv_map = { 1: 'a', 2: 'b' }I want to make it like this.How do I flip a key-value pair?


© 2024 OneMinuteCode. All rights reserved.