简体   繁体   中英

Python Turtle write() syntax error

I have a Problem. I am learning Python i get a EOL Error. I searching for a solution but i find nothing.

def gefangen(mx,my):
  if not geschafft:
    paula.write('Super, du hast Paula erwischt!')
  else:
    paula.write('Das zählt ja wohl nicht?!')
    onclick(start) # Mauskoordinaten werden
    paula.onclick(gefangen) # automatisch übergeben
  while paula.distance(horst) > 4:
    horst.fd(randint(3,7))
    horst.lt(randint(-20,40)/10)
    paula.setheading(paula.towards(horst))
    paula.fd(randint(1,10))
  if count % 20 == 0:
    horst.stamp()
    paula.stamp()
    count += 1
  if horst.ycor()<-260 or horst.xcor()>310:
    horst.write('Puh, geschafft!')
    paula.write('Mist, entwischt!')
    geschafft=True
  break
  if not geschafft:
    horst.write("Erwischt!",font=("Arial",14,"bold")")
    pu()
    goto(-200,-200)
    shape("circle")
    write("Noch einmal? Hier klicken")
    pd()
    st()

http://prntscr.com/gstq0d i get this error (look screenshot)

It looks like you have an extra double quote at "bold")") ...

if not geschafft:
    horst.write("Erwischt!",font=("Arial",14,"bold")")

horst.write("Erwischt!",font=("Arial",14,"bold")")

In this line, You have given an extra double quotes at the end.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM