Ask coding questions

← Back to all posts
What is wrong with this code?
DJWang (629)

what is wrong with this code:

def aimTarget():
for meteor in meteors:
if laser.xcor() = meteor.xcor() and laser.ycor() = meteor.ycor:
meteor.goto(meteor.xcor() - random.randint(1,15)
laser.hideturtle()

Answered by JoshDaBosh (77) [earned 5 cycles]
View Answer
Commentshotnewtop
JoshDaBosh (77)

first off, you should indent your code to make it more readable.

in line 3: replace the single equal signs with double equal signs
in line 4: you're missing an ending parenthesis after random.randint(1, 15)