Simplify code by dropping support for legacy Python (#1143)

* Simplify code by dropping support for legacy Python

* sort() --> sorted()
This commit is contained in:
Christian Clauss
2019-08-19 15:37:49 +02:00
committed by GitHub
parent 32aa7ff081
commit 47a9ea2b0b
145 changed files with 367 additions and 976 deletions

View File

@@ -8,9 +8,6 @@ method 2:
"Simpson Rule"
"""
from __future__ import print_function
def method_2(boundary, steps):
# "Simpson Rule"
# int(f) = delta_x/2 * (b-a)/3*(f1 + 4f2 + 2f_3 + ... + fn)

View File

@@ -7,8 +7,6 @@ method 1:
"extended trapezoidal rule"
"""
from __future__ import print_function
def method_1(boundary, steps):
# "extended trapezoidal rule"
# int(f) = dx/2 * (f1 + 2f2 + ... + fn)
@@ -19,7 +17,7 @@ def method_1(boundary, steps):
y = 0.0
y += (h/2.0)*f(a)
for i in x_i:
#print(i)
#print(i)
y += h*f(i)
y += (h/2.0)*f(b)
return y

View File

@@ -1,4 +1,3 @@
from __future__ import annotations
import datetime
import argparse
@@ -7,7 +6,7 @@ def zeller(date_input: str) -> str:
"""
Zellers Congruence Algorithm
Find the day of the week for nearly any Gregorian or Julian calendar date
Find the day of the week for nearly any Gregorian or Julian calendar date
>>> zeller('01-31-2010')
'Your date 01-31-2010, is a Sunday!'
@@ -108,7 +107,7 @@ def zeller(date_input: str) -> str:
# Validate
if not 0 < d < 32:
raise ValueError("Date must be between 1 - 31")
# Get second seperator
sep_2: str = date_input[5]
# Validate