{"id":5992,"date":"2023-10-29T10:40:37","date_gmt":"2023-10-29T05:10:37","guid":{"rendered":"https:\/\/python-programs.com\/?p=5992"},"modified":"2023-11-10T12:05:48","modified_gmt":"2023-11-10T06:35:48","slug":"python-how-to-create-a-list-of-all-the-values-in-a-dictionary","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-how-to-create-a-list-of-all-the-values-in-a-dictionary\/","title":{"rendered":"Python : How to Create a List of all the Values in a Dictionary ?"},"content":{"rendered":"

List:<\/strong><\/p>\n

A collection is a set of values that are arranged in a specific order. There could be different kinds of values. A list is a container that can be changed. Existing ones can be added to, deleted from, or changed as a result.<\/p>\n

The Python list is a mathematical representation of the concept of a finite sequence. List items or list elements are the names given to the values in a list. A list may contain multiple instances of the same value. Each event is treated as a separate element.<\/p>\n

Dictionary:<\/strong><\/p>\n

Dictionaries are Python’s implementation of an associative list, which can be a collection. A dictionary can be defined as a collection of key-value pairs that are kept together. Each key-value pair represents a key and its value.<\/p>\n

Given a dictionary, the task is to convert the values of dictionary to list.<\/p>\n

Examples:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

dictionary = {'Hello': 400, 'BtechGeeks': 900, 'Platform': 200}<\/pre>\n

Output:<\/strong><\/p>\n

[400, 900, 200]<\/pre>\n

Create a List of all the Values in a Dictionary<\/h2>\n