Idempotence — python

Manoj kumar
Sep 23 · 2 min read

It will be useful in interview point of view

What is Idempotence?

Idempotence is sometimes a confusing concept, at least from the academic definition. From a RESTful service standpoint, for an operation (or service call) to be idempotent, clients can make that same call repeatedly while producing the same result.

Definitely, it will be confusing. I know, But this the explanation from the internet. But the best part is, it is soo easy.

If something is running over and over again, but resulting in the same value all the iteration or times is called Idempotency.

When do we call a function Idempotence?

When a function is called over itself many times but when it results the same value is called Idempotence function.

See Abs is nothing but it returns the absolute value here the above example will always return 10 as a result. So it is called an idempotence function.

Where do we use?

If you ever worked with HTTP in API calling functionality. The GET request is actually an idempotence thing. When you send get request over and over, but the value remains the same as it said to idempotence.

That’s it, readers. It is one of the interview questions. It is common for all languages, so you can face interviews with confidence.

See you all in the next story.

Build for Billions

We make the technology, understandable for people. We believe that combination of Applied Science, mathematics, computers and Creativity led the world to innovate beyond the limits.

Manoj kumar

Written by

தமிழன், Engineer, programmer, History lover https://manojkumar-me.web.app

Build for Billions

We make the technology, understandable for people. We believe that combination of Applied Science, mathematics, computers and Creativity led the world to innovate beyond the limits.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade