Welcome back! Now that you've learned how to work with numbers in Redis, it's time to build on that knowledge and explore some basic operations with these numbers. This lesson will show you how to perform operations like incrementing, decrementing, and modifying numeric values directly in Redis.
In this lesson, you will learn how to:
- Increment and decrement numeric values.
 - Modify numeric values using operations such as increments by a floating point.
 
Here's the code snippet that we'll be working with:
Let's break it down:
- After setting initial values for 
count,completion_rate, andduration, we perform various operations:decr('count')decreases the value ofcountby 1. You can also provide a second argument todecrto decrement by a specific value:decr('count', 2)will decrementcountby 2. Note, thatdecrcan only be used on integer values.incrbyfloat('completion_rate', 1.5)incrementscompletion_rateby 1.5. Note, that this method can be used on integer and floating-point values.
 
Understanding how to perform operations with numbers in Redis is essential for real-world applications. Imagine you're building a learning management system: you would track user progress, completion rates, and time spent on courses. Redis makes it fast and easy to update these numbers in real-time.
By the end of this lesson, you'll be comfortable with basic numeric operations in Redis, preparing you for more advanced tasks. Ready to get started? Let's dive into the practice section and enhance your Redis skills!
