mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
Fixed xrange compatibility for Python 3
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
from __future__ import print_function
|
||||
from math import ceil
|
||||
|
||||
try:
|
||||
xrange #Python 2
|
||||
except NameError:
|
||||
xrange = range #Python 3
|
||||
|
||||
def diagonal_sum(n):
|
||||
total = 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user