Pyupgrade to Python 3.9 (#4718)

* Pyupgrade to Python 3.9

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
Christian Clauss
2021-09-07 13:37:03 +02:00
committed by GitHub
parent 5d5831bdd0
commit cecf43d648
142 changed files with 523 additions and 530 deletions

View File

@ -1,5 +1,5 @@
""" Luhn Algorithm """
from typing import List
from __future__ import annotations
def is_luhn(string: str) -> bool:
@ -17,9 +17,9 @@ def is_luhn(string: str) -> bool:
[False, False, False, True, False, False, False, False, False, False]
"""
check_digit: int
_vector: List[str] = list(string)
_vector: list[str] = list(string)
__vector, check_digit = _vector[:-1], int(_vector[-1])
vector: List[int] = [int(digit) for digit in __vector]
vector: list[int] = [int(digit) for digit in __vector]
vector.reverse()
for i, digit in enumerate(vector):