mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
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:
@ -44,10 +44,9 @@ Solution:
|
||||
Reference: https://en.wikipedia.org/wiki/Triangular_number
|
||||
https://en.wikipedia.org/wiki/Quadratic_formula
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from math import ceil, floor, sqrt
|
||||
from typing import List
|
||||
|
||||
|
||||
def solution(target: int = 2000000) -> int:
|
||||
@ -61,7 +60,7 @@ def solution(target: int = 2000000) -> int:
|
||||
>>> solution(2000000000)
|
||||
86595
|
||||
"""
|
||||
triangle_numbers: List[int] = [0]
|
||||
triangle_numbers: list[int] = [0]
|
||||
idx: int
|
||||
|
||||
for idx in range(1, ceil(sqrt(target * 2) * 1.1)):
|
||||
|
Reference in New Issue
Block a user