Contact: aviboots(AT)netvision.net.il
40,769 questions
53,151 answers
573 users
dic = {'a':13, 'c':8, 'd':24, 'e':36, 'f':17, 'g':6, 'h':25} dic = dict.fromkeys(dic, 0) print(dic) ''' run: {'a': 0, 'c': 0, 'd': 0, 'e': 0, 'f': 0, 'g': 0, 'h': 0} '''
dic = {'a':13, 'c':8, 'd':24, 'e':36, 'f':17, 'g':6, 'h':25} for key in dic: dic[key] = 0 print(dic) ''' run: {'a': 0, 'c': 0, 'd': 0, 'e': 0, 'f': 0, 'g': 0, 'h': 0} '''