Day 95: Data Types in Python
Understanding Lists, Tuples, and Dictionaries in Python for DevOps

Today, I explored Pythonโs core data structures โ lists, tuples, and dictionaries โ which are essential when managing infrastructure data, configurations, and automation logic in DevOps scripts.
๐ Lists
Lists are ordered and mutable collections โ perfect for storing groups of items like server names or container IDs.
servers = ["web01", "web02", "db01"]
servers.append("cache01")
print(servers)
โ Use case: Iterating over multiple resources to deploy or configure them.
๐ฆ Tuples
Tuples are ordered but immutable collections โ ideal when you want fixed sets of data that shouldnโt change.
region = ("us-east-1", "t2.micro")
print(region[0])
โ Use case: Storing static configurations like region + instance type pairs.
๐ Dictionaries
Dictionaries store key-value pairs โ useful for mapping resource names to their attributes.
config = {
"web01": "10.0.0.1",
"db01": "10.0.0.2"
}
print(config["web01"])
โ Use case: Handling inventory data, credentials, or service metadata in scripts.
๐ก Key Takeaways
โ
Lists โ Flexible and editable collections
โ
Tuples โ Safe, read-only collections
โ
Dictionaries โ Key-value mappings for structured data
๐ป These data types form the foundation of every Python automation script. Mastering them makes managing infrastructure data clean, efficient, and scalable.




