This repository contains various algorithm implementations in Python. Each algorithm is contained within its own subfolder, and each subfolder includes a main.py
file that contains the code for the algorithm.
The project is organized into two main categories:
integers
: Contains algorithms related to integer computations.strings
: Contains algorithms related to string manipulations.
The integers
folder contains the following subfolders, each representing a different algorithm:
ArmstrongNumber
: Code to check if a number is an Armstrong number.EvenOrOdd
: Code to determine if a number is even or odd.Factorial
: Code to compute the factorial of a number.Fibonacci
: Code to generate Fibonacci numbers.NumberOfDigits
: Code to count the number of digits in a number.Palindrom
: Code to check if a number is a palindrome.PrimeNumber
: Code to check if a number is prime.reverseNumber
: Code to reverse the digits of a number.SumOfDigits
: Code to sum the digits of a number.SwapNumbers
: Code to swap two numbers.
The strings
folder contains the following subfolders, each representing a different algorithm:
DuplicateCharacterCount
: Code to find duplicate characters in a string.Reverse String
: Code to reverse an entire string.ReverseEachWord
: Code to reverse each word in a string.OccurrenceOfEach
: Code to find the number of occurences of each character in a string.
Each subfolder contains a main.py
file with the implementation of the algorithm. To run any of the algorithms, navigate to the respective subfolder and execute the main.py
file.
For example, to run the Factorial
algorithm:
cd integers/Factorial
python main.py
- Python 3.x
If you would like to contribute, please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License - see the LICENSE file for details.