This is the error i get:
File "<stdin>", line 1
& "C:/Users/myName/AppData/Local/Microsoft/WindowsApps/python3.9.exe" "c:/xampp/htdocs/SD/UAS Prak/No1.py"
^
SyntaxError: invalid syntax
And here is my full code:
def proses(start,end):
peta = [
[5, 4, 6, 8, 9],
[3, 2, 5 ,1, 2],
[6, 2, 9, 9, 8],
[5, 1, 2, 3, 4],
[7, 8, 5, 3, 2]
]
path = []
kemungkinan = []
tempStart = start
for i in range(0,end[0]):
if tempStart[0] == 0:
tmp = peta[tempStart[0]+1][0]
tmp1 = peta[tempStart[0]+1][tempStart[1]+1]
kemungkinan.append([tmp,tmp1])
if tmp < tmp1:
path.append(tmp)
tempStart = [i+1][0]
else:
path.append(tmp1)
tempStart = [i+1][i+1]
if tempStart[0] != len(peta) and tempStart[1] != len(peta) and tempStart[0] != 0 and tempStart[1] != 0:
...
if tempStart[0] == len(peta) and tempStart[1] == len(peta):
...
print(path)
print(kemungkinan)
proses([0,1],[4,2])
What caused the error and how to fix it? proses([0,1],[4,2]) is part of the code