comparison python/dictify.py @ 881:4ebb6aff9d67

no more has_key
author Jeff Hammel <k0scist@gmail.com>
date Tue, 06 Aug 2019 14:22:00 -0700
parents cd1ebc68739f
children
comparison
equal deleted inserted replaced
880:cd1ebc68739f 881:4ebb6aff9d67
11 import sys 11 import sys
12 feh = sys.stdin.read() 12 feh = sys.stdin.read()
13 thedict = dictify(feh) 13 thedict = dictify(feh)
14 if sys.argv[1:]: 14 if sys.argv[1:]:
15 for i in sys.argv[1:]: 15 for i in sys.argv[1:]:
16 if thedict.has_key(i): 16 if i in thedict:
17 print (thedict[i]) 17 print (thedict[i])
18 else: 18 else:
19 print (thedict) 19 print (thedict)