def keys_only(dict): lst = [] for k, v in dict.items(): lst.append(k) return lst