Python Indexing and Slicing: Complete Tutorial With Hand-On Exercises

Almost all Python developers encounter indexing early on when they learn about lists. As you probably already know, Python lists have zero-based indexes. That is to say, given a list named movies, for example, movies[0] returns the first element in the ist, while movies[len(movies)-1] returns the last element. So far, there’s nothing to see here, … Read more

Python JSON: Easily Work With Dictionaries, Files, and Custom Objects

JSON (JavaScript Object Notation) is perhaps the most popular data-interchange format. Python has a built-in JSON package that lets you conveniently and quickly encode and decode JSON to and from Python dictionaries, which share a similar key/value structure but are much easier to manipulate in Python. This tutorial will show you how to work with … Read more

Python Dictionaries for Beginners: A Complete Lesson With Exercises

Python dictionaries are a popular and easy-to-use built-in type. Among the collection data types — the types programmers use to store and retrieve other objects — dictionaries are probably the most widely used class next to Python lists. Using Python dictionaries is simple to learn, but mastering them and remembering the syntax when you need … Read more