🛠️ToolsShed

Convertisseur d'Énergie

Convertissez entre joules, calories, kilocalories, kWh, BTU et électronvolts.

Questions Fréquentes

Implémentation du Code

# Energy conversions in Python

def joules_to_calories(j):
    """1 calorie = 4.184 joules"""
    return j / 4.184

def calories_to_joules(cal):
    return cal * 4.184

def joules_to_kwh(j):
    """1 kWh = 3,600,000 joules"""
    return j / 3_600_000

def kwh_to_joules(kwh):
    return kwh * 3_600_000

def joules_to_btu(j):
    """1 BTU = 1055.06 joules"""
    return j / 1055.06

def kcal_to_kj(kcal):
    return kcal * 4.184

# Examples
print(joules_to_calories(1000))   # 239.0 cal
print(calories_to_joules(1))      # 4.184 J
print(joules_to_kwh(3_600_000))   # 1.0 kWh
print(kcal_to_kj(100))            # 418.4 kJ (food energy)
print(joules_to_btu(1055.06))     # 1.0 BTU

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.