Skip to content

A lightweight Python class for converting numbers between different bases with ease.

License

PooryaSLT/baseConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”’ BaseConverter - Simple Python Class

A simple Python class to easily convert numbers between different bases.
Supports conversions between binary, decimal, octal, and hexadecimal with a clean and easy-to-use interface.


✨ Features

  • πŸ“ Lightweight and beginner-friendly Python class
  • πŸ”„ Convert numbers between any bases (binary, decimal, octal, hexadecimal)
  • ⚑ Fast and accurate results
  • πŸ’» Works with Python 3.x and higher

πŸš€ Usage

Create an instance of the class and call the convert method:

from BaseConverter import BaseConverter

app = BaseConverter()
result = app.convert(number, FromBase, ToBase)
print(result)

Example:

app = BaseConverter()
result = app.convert(1519, 10, 2)
print(result)  # Outputs binary representation of 1519

Parameters:

  • number – The number to convert
  • FromBase – Source base (e.g., 10 for decimal)
  • ToBase – Target base (e.g., 2 for binary)

πŸ“¬ Contact

πŸ’‘ Feel free to reach out if you have any questions or suggestions!

Telegram Email


⭐ If you like this project, don’t forget to star the repo!

About

A lightweight Python class for converting numbers between different bases with ease.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages