SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Y Daniel Lang
Chapter:
Programming
Exercise:
Programming Excercises
Question:4 | ISBN:978013274719 | Edition: 6

Question

(Convert pounds into kilograms) Write a program that converts pounds into kilograms. The program prompts the user to enter a value in pounds, converts it to kilograms, and displays the result. One pound is 0.454 kilograms. Here is a sample run:

Enter a value in pounds: 55.5
55.5 pounds is 25.197 kilograms

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

The folowing program helps to converts pounds into kilograms.

Code:

#(Convert pounds into kilograms
pounds = float(input('Enter a value in pounds: '))

# converts it to kilograms
kilograms = pounds * 0.454

# displays the result
print(pounds,"pounds is",kilograms,"kilograms")

 

output:

Enter a value in pounds: 55.5
55.5 pounds is 25.197 kilograms
>>> 

 

1 0

Discussions

Post the discussion to improve the above solution.