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

Popular posts from this blog

PYTHON PROGRAM THAT USES FOR LOOP TO PRINT THE NUMBERS 8,11,14,17,20,.........,83,86,89

PYTHON PROGRAM THAT ASKS THE USER TO ENTER TWO STRINGS OF SAME LENGTH AND WILL ALTERNATE THE CHARACTERS OF THE TWO STRINGS.FOR EXAMPLE: abcde and ABCDE THEN THE PROGRAM WILL PRINT AaBbCcDdEe

PYTHON PROGRAM THAT ASKS USER FOR LARGE INTEGERS AND INSERTS COMMAS INTO IT ACCORDING TO THE STANDARD AMERICAN CONVENTION FOR COMMAS IN LARGE NUMBERS