Python Program - Convert Kilograms to Pounds
Python Program - Convert Kilograms to Pounds
To convert Kilograms to Pounds in Python, you can use the following formula in the program.
Pounds = Kilograms * 2.20462262185
Let us write a function, that takes the Pounds value as argument, computes the Kilograms using the above formula, and returns the result.
def kilogramsToPounds(kilograms):
return kilograms * 2.20462262185
You may use this function, in your program, to convert Kilograms to Pounds.
The following is an example program, where we shall use the above conversion function, and convert 10
Kilograms to Pounds and print the result to output.
Python Program
# Function that converts Kilograms to Pounds
def kilogramsToPounds(kilograms):
return kilograms * 2.20462262185
if __name__ == "__main__":
# Given kilograms
kilograms = 10
# Convert Kilograms to Pounds
pounds = kilogramsToPounds(kilograms)
print(f"{kilograms} Kilograms is equal to {pounds} Pounds")
Output
10 Kilograms is equal to 22.0462262185 Pounds
To implement the formula, we used Python Multiplication from Arithmetic Operators.
To verify your output, you can use this online tool: Convert Kilograms to Pounds online by ConvertOnline.org.