On Sun, 01 Apr 2018 20:52:35 -0400, C W wrote: > Thank you all for the response. > > What if I have myDict = {'a': 'B', 'b': 'C',...,'z':'A' }? So now, the > values are shift by one position. > > key: abcdefghijklmnopqrstuvwxyz > value: BCDEFGHIJKLMNOPQRSTUVWXYZA > > Can I fill in a key and its corresponding value simultaneously on the > fly?
Of course. myDict = dict(zip("abcdefghijklmnopqrstuvwxyz", "BCDEFGHIJKLMNOPQRSTUVWXYZA")) -- Steve -- https://mail.python.org/mailman/listinfo/python-list