@@ -81,6 +81,7 @@ def __categorize_system(argument_value: float, argument_name: str) -> None:
8181 error_msg = "Should be 'work', 'heat', or 'internal_energy_variation'."
8282 raise ValueError (f"{ error_type } { error_msg } " )
8383
84+
8485def work (heat : float , internal_energy_variation : float ) -> float :
8586 """
8687 >>> work(50.0, -20.0)
@@ -104,7 +105,7 @@ def work(heat: float, internal_energy_variation: float) -> float:
104105
105106 __categorize_system (heat , "heat" )
106107 __categorize_system (internal_energy_variation , "internal_energy_variation" )
107-
108+
108109 work = heat - internal_energy_variation
109110 __categorize_system (work , "work" )
110111 return round (work , 1 )
@@ -133,7 +134,7 @@ def heat(internal_energy_variation: float, work: float) -> float:
133134
134135 __categorize_system (internal_energy_variation , "internal_energy_variation" )
135136 __categorize_system (work , "work" )
136-
137+
137138 heat = round (internal_energy_variation + work , 1 )
138139 __categorize_system (heat , "heat" )
139140 return heat
@@ -162,7 +163,7 @@ def internal_energy_variation(heat: float, work: float) -> float:
162163
163164 __categorize_system (heat , "heat" )
164165 __categorize_system (work , "work" )
165-
166+
166167 internal_energy_variation = round (heat - work , 1 )
167168 __categorize_system (internal_energy_variation , "internal_energy_variation" )
168169 return internal_energy_variation
0 commit comments