I may be misunderstanding this, but it looks like you may be asking a user to give you either a key or a value. If they give you a key you want to return the value and if they give you a value you want to return the key.
If that is what you are looking for, the easiest way to do this is to add entries to the dictionary with the values and keys swapped, for example:
streetno={"1":"Sachin Tendulkar","2":"Sehawag","3":"Dravid","4":"Dhoni","5":"Kohli"}
streetno.update([(v, k) for k, v in streetno.items()])
This results in the following dictionary:
>>> pprint(streetno)
{'1': 'Sachin Tendulkar',
'2': 'Sehawag',
'3': 'Dravid',
'4': 'Dhoni',
'5': 'Kohli',
'Dhoni': '4',
'Dravid': '3',
'Kohli': '5',
'Sachin Tendulkar': '1',
'Sehawag': '2'}
With this you can get the input and look up the value in the dictionary without any additional checking:
key = raw_input("Enter name or number (i/p):")
result = streetno.get(key)
If you are using Python 3.x, replace raw_input()
with input()
.