2020"""
2121
2222
23- def check_args (argument : float ) -> None :
23+ def __check_args (argument : float ) -> None :
2424 """
2525 Check that the arguments are valid
2626 """
@@ -30,7 +30,7 @@ def check_args(argument: float) -> None:
3030 raise TypeError ("Invalid argument. Should be an integer or float." )
3131
3232
33- def categorize_system (argument_value : float , argument_name : str ) -> None :
33+ def __categorize_system (argument_value : float , argument_name : str ) -> None :
3434 """
3535 Categorizes the system based on the work done, heat added/removed,
3636 and internal energy variation.
@@ -79,14 +79,14 @@ def work(heat: float, internal_energy_variation: float) -> float:
7979 The system is compressing.
8080 -70.0
8181 """
82- check_args (heat )
83- check_args (internal_energy_variation )
82+ __check_args (heat )
83+ __check_args (internal_energy_variation )
8484
85- categorize_system (heat , "heat" )
86- categorize_system (internal_energy_variation , "internal_energy_variation" )
85+ __categorize_system (heat , "heat" )
86+ __categorize_system (internal_energy_variation , "internal_energy_variation" )
8787
8888 work = heat - internal_energy_variation
89- categorize_system (work , "work" )
89+ __categorize_system (work , "work" )
9090 return round (work , 1 )
9191
9292def heat (internal_energy_variation : float , work : float ) -> float :
@@ -107,14 +107,14 @@ def heat(internal_energy_variation: float, work: float) -> float:
107107 The system is exothermic (releasing heat).
108108 -50.0
109109 """
110- check_args (internal_energy_variation )
111- check_args (work )
110+ __check_args (internal_energy_variation )
111+ __check_args (work )
112112
113- categorize_system (internal_energy_variation , "internal_energy_variation" )
114- categorize_system (work , "work" )
113+ __categorize_system (internal_energy_variation , "internal_energy_variation" )
114+ __categorize_system (work , "work" )
115115
116116 heat = round (internal_energy_variation + work , 1 )
117- categorize_system (heat , "heat" )
117+ __categorize_system (heat , "heat" )
118118 return heat
119119
120120def internal_energy_variation (heat : float , work : float ) -> float :
@@ -135,14 +135,14 @@ def internal_energy_variation(heat: float, work: float) -> float:
135135 The internal energy of the system is increasing. It heating up.
136136 20.0
137137 """
138- check_args (heat )
139- check_args (work )
138+ __check_args (heat )
139+ __check_args (work )
140140
141- categorize_system (heat , "heat" )
142- categorize_system (work , "work" )
141+ __categorize_system (heat , "heat" )
142+ __categorize_system (work , "work" )
143143
144144 internal_energy_variation = round (heat - work , 1 )
145- categorize_system (internal_energy_variation , "internal_energy_variation" )
145+ __categorize_system (internal_energy_variation , "internal_energy_variation" )
146146 return internal_energy_variation
147147
148148if __name__ == "__main__" :
0 commit comments