cloth = {'shirt':1000,
'jacket':2000,
'cap':500}
for key,values in cloth.items():
piece = input('tell item: ')
if piece in cloth.keys():
n = int(input('n: '))
if n<=2:
print(n*cloth.values())
break
else:
print('out of range')
else:
print(None)
If I try to take input as 'cap' in piece input and 'n' as 2 as try to compare it to the value in dict, I want the final answer to be 1000 and instead I am getting the value to be capcap.