Skip to content

A simple Python tool that converts numbers between binary, decimal, octal, and hexadecimal formats. Includes a menu-driven interface, input validation, and easy-to-read output for quick base conversions.

Notifications You must be signed in to change notification settings

Abrar-Shahriar-04/Binary-Decimal-Octal-Hex-Converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Number System Converter is a beginner-friendly Python program that allows users to convert numbers between different numeral systems: binary, decimal, octal, and hexadecimal. It features a simple menu-driven interface where users can choose the type of conversion they want and enter a number in the corresponding format.

The program supports the following conversions:

  • Binary → Decimal, Octal, Hexadecimal
  • Decimal → Binary, Octal, Hexadecimal
  • Octal → Binary, Decimal, Hexadecimal
  • Hexadecimal → Binary, Decimal, Octal

Each conversion is handled by a dedicated function that:

  • Takes user input
  • Validates the input using a try-except block to prevent crashes
  • Converts the number to decimal using Python’s built-in int() function with the appropriate base
  • Then converts the decimal to the other number systems using the format() function

After each conversion, the user is prompted whether they want to continue using the tool or exit the program.

This project is great for:

  • Practicing basic Python
  • Understanding numeral systems
  • Learning how to structure interactive command-line programs

Features:

  • Easy-to-use text-based interface
  • Input validation with helpful error messages
  • Support for uppercase/lowercase hexadecimal inputs
  • Runs continuously until the user decides to exit
  • Clean, modular functions for each conversion type

About

A simple Python tool that converts numbers between binary, decimal, octal, and hexadecimal formats. Includes a menu-driven interface, input validation, and easy-to-read output for quick base conversions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages