+ 1
Can someone help me with this?
9 Réponses
+ 2
because your 2nd for loop sets pos as the 9th iteration THEN prints it. you're telling it to count to nine then tell you what number it's on. you should instead tell it to count to 9, and for every number tell you what number its on. which is simply putting the print in the for loop.
for i in range(10)
pos= i, campo[i].index("x")
print(pos)
+ 2
#then do an if statement
if campo[i] == "x":
pos=i
+ 2
Arthur
#oh right. I forgot. same thing still applies, except its:
if "x" in campo[i]:
pos=i
+ 1
Ahri Fox But pos is the variable to know where the "x" is located
+ 1
Ahri Fox But campo is an array inside an array