Open ropering opened 2 years ago
def key_only(dict): lst = [] for k, v in dict.items(): lst.append(k) return lst ages = { 'Emma' : 27, 'Walter' : 26, 'Watson' : 42, } key_only(ages) # ['Emma', 'Walter', 'Watson']