How To Write Efficient Code

TechWithMK
Nov 25, 2022

--

Create Your Functions

Functions allows you to call and execute a code-block multiple times

Avoid repeating the same code over and over again

Use Suitable Algorithms

Think about the time and space complexity of your code

Remember-Simplicity is your friend

Minimize use of If-Else

Make your code more readable, store code on array or dictionaries

Find a good strategy that helps your code to be less complex

Break Loops When Needed

The number of iterations should be small. Add a condition that helps stopping it

Makes it easier and low-cost for the computer

Did you find this article helpful Follow TechWithMK

You should definitely check out my other blogs:

Best way to Learn Python

Understanding OOPS

Understand The Concepts of Data Structure

Tips on Learning DataStructures

Algorithms-Every developer should know

--

--

TechWithMK

Your future is created by what you do today not tomorrow!