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

@ -6,13 +6,6 @@ to 10 without any remainder.
What is the smallest positive number that is evenly divisible(divisible with no
remainder) by all of the numbers from 1 to N?
"""
from __future__ import print_function
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
""" Euclidean GCD Algorithm """
@ -30,7 +23,7 @@ def lcm(x, y):
def solution(n):
"""Returns the smallest positive number that is evenly divisible(divisible
with no remainder) by all of the numbers from 1 to n.
>>> solution(10)
2520
>>> solution(15)
@ -47,4 +40,4 @@ def solution(n):
if __name__ == "__main__":
print(solution(int(raw_input().strip())))
print(solution(int(input().strip())))