Python Program to convert kilo grams into pounds and vice versa.
Formula to convert kg to pounds and vice versa
To convert pounds into kilograms, divide the number of pounds you have by 2.2046.
Program statements kg to pounds and vice versa
How this Python Program works?
First of all we use print() to display a menu for the user. This menu consists of two choices as follows:
**** Program Menu ****
1. Convert KG to Pounds
2. Convert Pounds to Kg
After this menu the user will enter her choice. Then we will use an if-elif statement to select the proper block of statements for execution on the basis of user’s choice.
After the input by the user that is in kg or pounds, the result is shown on the screen properly after conversion. Moreover, if the use will enter a number other than one or two then this program will show a message “Wrong Choice”. We have used print(), input(), if-elif and float() functions in this Python program to get the required results.
You may also like:
730 total views, 3 views today