python 3.x - How to eliminate prompt when adding new value to dictionary? -


question worded weirdly. it's hard word in few words. here go: have written program prompts user name , data associated them. if enter same name second time, program ask if want update in case, type y (for yes) , can enter new data stored. when hit enter or return twice, program list keys , values.

here code:

def thing():      store = {}      while true:         name = input('perp: ')         if not name:             k, v in store.items():                 print('perp' + k + ' has ' + v)             break          if name in store:              if input(name + ' has ' + store[name] + '. update? ') != 'y':                 continue          store[name] = input('item: ') 

now, want eliminate whole prompt give in code
if input(name + ' has ' + store[name] + '. update? ') != 'y':. want when enter name second time, show me item: , enter item , when hit enter twice , lists keys , values, show me updated pair.

i want eliminate prompt of asking user whether want update or not. if enter name in second time, assume intention.

i've tried messing line of code lot tried
if input('item: ')!= '', failed. , bunch of other variations of code. realized need eliminate input, in way. when deleted line, code didn't work should. know fact tiny fix have been staring @ hours , can't it.

an output this:

perp: batman
item: batarang
perp: superman
item: heat vision
perp: syndrome
item: stupidity
perp: batman
item: kryptonite
perp:
batman has kryptonite
superman has heat vision
syndrome has stupidity

ps, sorry if superhero examples upset you.

here code exactly.

enter image description here

just skip if name in store: check , ask item again when name not blank:

def thing():      store = {}      while true:         name = input('perp: ')         if not name:             k, v in store.items():                 print('perp' + k + ' has ' + v)             break         else:                 store[name] = input('item: ')