Giter Site home page Giter Site logo

hasancyhn / base-conversion Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 354 KB

This project contains Python code that converts binary numbers entered by the user into decimal base, and decimal numbers into binary base.

Python 100.00%
base-conversion binary-to-decimal decimal-to-binary python python-programming python-project

base-conversion's Introduction

Base-Conversion

This project contains Python code that converts binary numbers entered by the user into decimal base, and decimal numbers into binary base.

BASE CONVERSION Write a Python code that converts binary numbers entered by the user into decimal base, and decimal numbers into binary base.

1- When the program is executed, the user should be presented with 3 options: "Convert from binary to decimal", "Convert from decimal to binary", and "Exit". The program should continue to operate on the same menu until the user chooses to exit.

2- After selecting an option, the user should enter a number that will be converted to the appropriate base and displayed on the screen.

3- For the option of converting from binary to decimal, the program should check if the entered number contains only 0s and 1s. If the entered number is not valid, the user should be prompted to enter a valid binary number.

4- All operations should be done using loops and conditional statements, without using functions or arrays.

5- No built-in functions should be used except for input and output functions.

6- No external Python libraries should be imported.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.