I have a list ListA
:
ListA = [ 'Key1: test1', 'Key2: test2', 'Key3: test3']
What I'm trying to do is I want to search a certain value to it respective key. For example: If user input test1
, it should return me Key1
OR If user input test3
, it should return me Key3
. I research a lot on the internet but it seem many are talking about comparing the two different list but not comparing the same list. I'm still new to programming, so I want to ask does my idea are lousy? Is it a better way to do it ?