mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-19 19:03:02 +08:00
Simplify code by dropping support for legacy Python (#1143)
* Simplify code by dropping support for legacy Python * sort() --> sorted()
This commit is contained in:
@ -1,12 +1,6 @@
|
||||
from __future__ import print_function
|
||||
import heapq
|
||||
import numpy as np
|
||||
|
||||
try:
|
||||
xrange # Python 2
|
||||
except NameError:
|
||||
xrange = range # Python 3
|
||||
|
||||
|
||||
class PriorityQueue:
|
||||
def __init__(self):
|
||||
@ -96,7 +90,7 @@ def do_something(back_pointer, goal, start):
|
||||
grid[(n-1)][0] = "-"
|
||||
|
||||
|
||||
for i in xrange(n):
|
||||
for i in range(n):
|
||||
for j in range(n):
|
||||
if (i, j) == (0, n-1):
|
||||
print(grid[i][j], end=' ')
|
||||
|
Reference in New Issue
Block a user