Sure, here are some examples of how to put data into different data structures using Python:
List:
A list is a collection of items that are ordered and changeable. Here's an example of how to create a list and add some data to it:
my_list = [1, 2, 3, "four", 5.0]
Dictionary:
A dictionary is a collection of key-value pairs that are unordered and changeable. Here's an example of how to create a dictionary and add some data to it:
my_dict = {"name": "John", "age": 30, "city": "New York"}
Tuple:
A tuple is a collection of items that are ordered and unchangeable. Here's an example of how to create a tuple:
my_tuple = (1, 2, 3, "four", 5.0)
A set is a collection of unique items that are unordered and unchangeable. Here's an example of how to create a set:
my_set = {1, 2, 3, "four", 5.0}
Note: You can add data to a list, dictionary, or set using the append() method, update() method, and add() method, respectively.
If you want to learn more, join
CETPA Infotech.