Python Code Snippets
Lists
# Creating a list
my_list = []
my_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
# List of different data types
mixed_list = [1, "hello", 3.14, True]
# Accessing elements
print(my_list[0]) # Output: 1
print(my_list[-1]) # Output: 5
# Append to the e...
madhavganesan.hashnode.dev8 min read