On 09/26/2016 05:25 PM, Cai Gengyang wrote:
I just wanted to note that sometimes the code works, sometimes it doesn't.
(even though both are exactly the same code) ... Weird , dum dum dum
for row in range(10):
for column in range(10):
print("*",end="")
SyntaxError: inconsistent use of tabs and spaces in indentation
for row in range(10):
for column in range(10):
print("*",end="")
Here,
from itertools import product
for row,column in product(range(10), range(10)): print("*", end="")
Problem solved :)
On a more serious note, they're not the same code, in the same way than
print("foo")
print("bar")
is not the same code than
print("foo")print("bar")
You're fooled by your editor which displays 2 different characters the
same way. Tab or space does matter in python, get over it and move on
with your python life. Actually python is a great debugger for
misconfigured text editors.
jm
--
https://mail.python.org/mailman/listinfo/python-list