2018年1月9日 星期二

Python: Convert pressure in kilopascals to pounds

Python: Convert pressure in kilopascals to pounds

Python Basic: Exercise-67 with Solution

Write a Python program to convert pressure in kilopascals to pounds per square inch,a millimeter of mercury (mmHg) and atmosphere pressure.
Sample Solution:-
kpa = float(input("Input pressure in in kilopascals> "))
psi = kpa / 6.89475729
mmhg = kpa * 760 / 101.325
atm = kpa / 101.325
print("The pressure in pounds per square inch: %.2f psi"  % (psi))
print("The pressure in millimeter of mercury: %.2f mmHg" % (mmhg))
print("Atmosphere pressure: %.2f atm." % (atm))

=========== RESTART: F:/Python_APSC/py-ex-basic-67.py ===========
Input pressure in in kilopascals> 15.8
The pressure in pounds per square inch: 2.29 psi
The pressure in millimeter of mercury: 118.51 mmHg
Atmosphere pressure: 0.16 atm.
>>> 

沒有留言:

張貼留言

CRC(循環冗餘檢查)

  CRC(循環冗餘檢查) 完整的 CRC(循環冗餘檢查)逐步演示器 。它支援自定義 生成多項式 與 資料位元流 ,並透過「下一步」按鈕展示二進制長除法(XOR 運算)的過程。 二進制長除法模擬 : CRC 的核心是模二除法(Modulo-2 Division),實務上就是不斷進...