I used the code below in python 3.9 and it runs with no problem at all but when I use it in 2.7 version it doesnt work I retyped the code 5 times and still doesnt work. it gives me syntax error for the else
Please help me with this
for row in range(7):
for col in range(11):
if ((col==0 or col==6 or col==10) or (row==3 and col==1))or((row==2) and (col==2 or col==8)) or (row==4 and col==2) or ((row==1) and (col==3 or col==7 or col==9)) or (row==5 and col==3) or ((row==0 or row==6) and (col==4)):
print("*",end="")
else:
print(end=" ")
print()
question from:https://stackoverflow.com/questions/65859875/why-do-i-get-syntax-error-for-else-statement-in-python-2-7