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

@ -65,13 +65,8 @@ def levenshtein_distance(first_word, second_word):
if __name__ == '__main__':
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
first_word = raw_input('Enter the first word:\n').strip()
second_word = raw_input('Enter the second word:\n').strip()
first_word = input('Enter the first word:\n').strip()
second_word = input('Enter the second word:\n').strip()
result = levenshtein_distance(first_word, second_word)
print('Levenshtein distance between {} and {} is {}'.format(