Skip to content

Commit 26decf1

Browse files
Merge branch 'feature/ViniAntunes/first_law_of_thermodynamics' of https://github.com/ViniViniAntunes/Python into feature/ViniAntunes/first_law_of_thermodynamics
2 parents 9652948 + d53a1d8 commit 26decf1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

physics/first_law_of_thermodynamics.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ def __categorize_system(argument_value: float, argument_name: str) -> None:
4343
print("The system is expanding.")
4444
elif argument_value < 0:
4545
print("The system is compressing.")
46-
46+
4747
elif argument_name == "heat":
4848
if argument_value == 0:
4949
print("The system is adiabatic (no heat exchange).")
5050
elif argument_value > 0:
5151
print("The system is endothermic (absorbing heat).")
5252
elif argument_value < 0:
5353
print("The system is exothermic (releasing heat).")
54-
54+
5555
elif argument_name == "internal_energy_variation":
5656
if argument_value == 0:
5757
print("The system is isothermic (constant internal energy)")
@@ -89,6 +89,7 @@ def work(heat: float, internal_energy_variation: float) -> float:
8989
__categorize_system(work, "work")
9090
return round(work, 1)
9191

92+
9293
def heat(internal_energy_variation: float, work: float) -> float:
9394
"""
9495
>>> heat(-20.0, 30.0)
@@ -117,6 +118,7 @@ def heat(internal_energy_variation: float, work: float) -> float:
117118
__categorize_system(heat, "heat")
118119
return heat
119120

121+
120122
def internal_energy_variation(heat: float, work: float) -> float:
121123
"""
122124
>>> internal_energy_variation(50.0, 30.0)
@@ -145,6 +147,7 @@ def internal_energy_variation(heat: float, work: float) -> float:
145147
__categorize_system(internal_energy_variation, "internal_energy_variation")
146148
return internal_energy_variation
147149

150+
148151
if __name__ == "__main__":
149152
from doctest import testmod
150153

0 commit comments

Comments
 (0)