PYTHON PROGRAM TO CONVERT KILOGRAMS TO POUNDS
BASIC PROGRAM IN PYTHON:
1) Write a program that asks the user for a weight in kilograms and converts it to pounds. There are 2.2 pounds in a kilogram.
CODE:
weight=float(input("Enter weight in kilograms:"))
pounds=2.2*weight
print("Weight in pounds:",pounds)
EXPLANATION:
In the first line of code, the input() function in python asks the user to enter the weight in kilograms.
In second line,weight in kilograms will be converted to pounds.
In third line, the print() function in python is used to print the weight in pounds.
OUTPUT:
Comments
Post a Comment