Source Code:
(back to article)
# Create a sample dictionary my_dict = {'a': 1, 'b': 2, 'c': 3} # Get a view of the dictionary keys keys = my_dict.keys() # Convert the view to a list keys_list = list(keys) print(keys_list) # Output: ['a', 'b', 'c']
Result:
Report an issue