Fixed xrange compatibility for Python 3

This commit is contained in:
Daniel Ingram
2018-03-19 09:29:46 -04:00
parent 2d2644ee17
commit c6c5d62311
3 changed files with 15 additions and 0 deletions

View File

@ -1,5 +1,10 @@
from __future__ import print_function
try:
xrange #Python 2
except NameError:
xrange = range #Python 3
def fibonacci(n):
if n == 1 or type(n) is not int:
return 0