Skip to content

Commit 7a1d502

Browse files
committed
Update code file after TR
1 parent 7350552 commit 7a1d502

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

python-join-strings/format_event_log.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33

44
def load_log_file(file_path):
5-
with open(file_path, mode="r", encoding="utf-8") as event_log_file:
6-
return json.load(event_log_file)
5+
with open(file_path, mode="r", encoding="utf-8") as file:
6+
return json.load(file)
77

88

99
def format_event_log(event_log):
1010
lines = []
1111
for timestamp, events in event_log.items():
12-
# Convert the events list to a string separated by commas.
12+
# Convert the events list to a string separated by commas
1313
event_list_str = ", ".join(events)
14-
# Create a single line string.
14+
# Create a single line string
1515
line = f"{timestamp} => {event_list_str}"
1616
lines.append(line)
1717

18-
# Join all lines with a newline separator.
18+
# Join all lines with a newline separator
1919
return "\n".join(lines)
2020

2121

0 commit comments

Comments
 (0)