mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
pyupgrade --py37-plus **/*.py (#1654)
* pyupgrade --py37-plus **/*.py * fixup! Format Python code with psf/black push
This commit is contained in:

committed by
John Law

parent
34c808b375
commit
28419cf839
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Problem:
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Problem:
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Problem:
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Problem:
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
By listing the first six prime numbers:
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
By listing the first six prime numbers:
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
By listing the first six prime numbers:
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
The four adjacent digits in the 1000-digit number that have the greatest
|
||||
product are 9 × 9 × 8 × 9 = 5832.
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
The four adjacent digits in the 1000-digit number that have the greatest
|
||||
product are 9 × 9 × 8 × 9 = 5832.
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
The four adjacent digits in the 1000-digit number that have the greatest
|
||||
product are 9 × 9 × 8 × 9 = 5832.
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Problem Statement:
|
||||
The following iterative sequence is defined for the set of positive integers:
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Collatz conjecture: start with any positive integer n. Next term obtained from
|
||||
the previous term as follows:
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -.- coding: latin-1 -.-
|
||||
from math import sqrt
|
||||
|
||||
"""
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: latin-1 -*-
|
||||
"""
|
||||
Name scores
|
||||
Problem 22
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: latin-1 -*-
|
||||
"""
|
||||
Name scores
|
||||
Problem 22
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
The Fibonacci sequence is defined by the recurrence relation:
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
The Fibonacci sequence is defined by the recurrence relation:
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
The Fibonacci sequence is defined by the recurrence relation:
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Coin sums
|
||||
Problem 31
|
||||
|
@ -46,13 +46,11 @@ def solution():
|
||||
"""
|
||||
|
||||
return sum(
|
||||
set(
|
||||
[
|
||||
int("".join(pandigital[5:9]))
|
||||
for pandigital in itertools.permutations("123456789")
|
||||
if isCombinationValid(pandigital)
|
||||
]
|
||||
)
|
||||
{
|
||||
int("".join(pandigital[5:9]))
|
||||
for pandigital in itertools.permutations("123456789")
|
||||
if isCombinationValid(pandigital)
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
|
||||
|
@ -43,7 +43,7 @@ def solve(digit_len: int) -> str:
|
||||
while den <= 99:
|
||||
if (num != den) and (num % 10 == den // 10) and (den % 10 != 0):
|
||||
if isDigitCancelling(num, den):
|
||||
solutions.append("{}/{}".format(num, den))
|
||||
solutions.append(f"{num}/{den}")
|
||||
den += 1
|
||||
num += 1
|
||||
den = 10
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -.- coding: latin-1 -.-
|
||||
"""
|
||||
Champernowne's constant
|
||||
Problem 40
|
||||
|
@ -1,4 +1,3 @@
|
||||
# -.- coding: latin-1 -.-
|
||||
"""
|
||||
Combinatoric selections
|
||||
Problem 53
|
||||
|
Reference in New Issue
Block a user