mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Add Flake8 comprehensions to pre-commit (#7235)
* ci(pre-commit): Add ``flake8-comprehensions`` to ``pre-commit`` (#7233) * refactor: Fix ``flake8-comprehensions`` errors * fix: Replace `map` with generator (#7233) * fix: Cast `range` objects to `list`
This commit is contained in:
@ -28,8 +28,8 @@ def solution():
|
||||
with open(triangle) as f:
|
||||
triangle = f.readlines()
|
||||
|
||||
a = map(lambda x: x.rstrip("\r\n").split(" "), triangle)
|
||||
a = list(map(lambda x: list(map(int, x)), a))
|
||||
a = (x.rstrip("\r\n").split(" ") for x in triangle)
|
||||
a = [list(map(int, x)) for x in a]
|
||||
|
||||
for i in range(1, len(a)):
|
||||
for j in range(len(a[i])):
|
||||
|
Reference in New Issue
Block a user