Convertitore di Potenza
Converti tra watt, kilowatt, megawatt, cavalli vapore e BTU/h.
Domande Frequenti
Implementazione del Codice
# Power conversions in Python
def watts_to_horsepower(w):
"""Mechanical horsepower (US): 1 HP = 745.7 W"""
return w / 745.7
def horsepower_to_watts(hp):
return hp * 745.7
def watts_to_metric_hp(w):
"""Metric horsepower (PS): 1 PS = 735.5 W"""
return w / 735.499
def kw_to_btu_per_hour(kw):
"""1 kW = 3412.14 BTU/h"""
return kw * 3412.14
def btu_per_hour_to_watts(btu_h):
return btu_h * 0.29307
# Examples
print(watts_to_horsepower(1000)) # 1.341 HP
print(horsepower_to_watts(100)) # 74570 W (74.57 kW)
print(watts_to_metric_hp(1000)) # 1.360 PS
print(kw_to_btu_per_hour(3.5)) # 11942 BTU/h (typical AC)Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.