exception - Python range with variables -
i have write code below:
start = 96 range = 5 d in range(start, start+range): print d
but exception below:
traceback (most recent call last): file "<stdin>", line 1, in <module> typeerror: 'int' object not callable
does python not support multiple variable in range function?
you overwrote range
.
>>> range(5) [0, 1, 2, 3, 4] >>> range = 2 >>> range(2) traceback (most recent call last): file "<stdin>", line 1, in <module> typeerror: 'int' object not callable
shadowing(overwriting) builtin function not practice.
Comments
Post a Comment