MCPcopy Create free account
hub / github.com/geekcomputers/Python / read_test_cases

Function read_test_cases

time_delta.py:73–93  ·  view source on GitHub ↗

Read test cases from standard input. Returns: A tuple containing: - Number of test cases - List of timestamp pairs for each test case

()

Source from the content-addressed store, hash-verified

71
72
73def read_test_cases() -> Tuple[int, List[Tuple[str, str]]]:
74 """
75 Read test cases from standard input.
76
77 Returns:
78 A tuple containing:
79 - Number of test cases
80 - List of timestamp pairs for each test case
81 """
82 try:
83 num_test_cases = int(input().strip())
84 test_cases = []
85
86 for _ in range(num_test_cases):
87 timestamp1 = input().strip()
88 timestamp2 = input().strip()
89 test_cases.append((timestamp1, timestamp2))
90
91 return num_test_cases, test_cases
92 except ValueError as e:
93 raise ValueError("Invalid input format") from e
94
95
96def main() -> None:

Callers 1

mainFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected