# Short way fruits = {'apple': 2, 'pear': 5, 'strawberry': 3} if fruits.get('apple'): print('Key found')