+ 1
What are algorithms
Please answer me what is algorithms and how can we code a algorithm using python
4 ответов
+ 4
A programming algorithm is a computer procedure that is a lot like a recipe (called a procedure) and tells your computer precisely what steps to take to solve a problem or reach a goal.
+ 4
Algorithm is a procedure to implement a task.
+ 3
Simply put, an algorithm is any set of instructions we follow to "do something". As long as you follow the instructions to the letter, you will be able to solve a specific problem, for example
Similarly, programming languages are what people use to convey instructions to computers, in order to solve problems. This is exactly what an algorithm is! Chances are, you have used a couple already without realising it
For example, to check if a number is even, we perform a modulus operator on it and check if there is a remainder. In python code that would be:
if num%2 == 0:
print("Is Even")
else:
print("Is odd")
This is perhaps one of the simplest algorithms, but they can be infinitely more complex