Skip to content

Commit 7e443e5

Browse files
committed
update comments
1 parent c0320d2 commit 7e443e5

File tree

1 file changed

+6
-11
lines changed
  • demo-assignments/A1-OOP/cold

1 file changed

+6
-11
lines changed

demo-assignments/A1-OOP/cold/cold.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ def __init__(self) -> None:
3030
def find_answer(self) -> int:
3131
"""Counts the number of temperatures below zero
3232
33-
Args:
34-
temps (List[int]): List of temperatures
35-
3633
Returns:
3734
int: number of temperatures below zero
3835
"""
@@ -43,10 +40,10 @@ def find_answer(self) -> int:
4340
return count
4441

4542
def read_data(self, source: Any) -> None:
46-
""" Reads data from stdin.
43+
""" Reads data from provided source.
4744
4845
Args:
49-
source (Any): stdin typically
46+
source (Any): stdin typically for kattis problem
5047
"""
5148
# ignore the first line
5249
data = source.readlines()
@@ -55,10 +52,10 @@ def read_data(self, source: Any) -> None:
5552
self._temps = [Temperature(int(i)) for i in self._data.split()]
5653

5754
def get_n(self) -> int:
58-
"""Returns the number of temperatures
55+
"""Returns the number of temperature readings
5956
6057
Returns:
61-
int: number of temperatures
58+
int: number of temperature readings
6259
"""
6360
return self._n
6461

@@ -71,17 +68,15 @@ def get_data(self) -> str:
7168
return self._data
7269

7370
def solve(self, source: Any) -> None:
74-
"""
75-
Solves the problem
76-
:return: None
71+
""" Solves the problem.
7772
"""
7873
self.read_data(source)
7974
print(self.find_answer())
8075
# sys.stdout.write('1')
8176

8277
@staticmethod
8378
def main() -> None:
84-
"""main static method
79+
"""Entry static method
8580
"""
8681
sol = Solution()
8782
sol.solve(sys.stdin)

0 commit comments

Comments
 (0)