PASO 11: ¿Cuál es la pendiente de esta línea? ¡Preguntémosle al usuario! Tendremos que usar la notación de puntos .

  • En busque el bloque Ask for Float y arrástrelo al editor de código.
  • Cambie la cadena entre paréntesis a "What is the slope of this line?"
  • Cambie la variable (la palabra a la izquierda del signo igual) de guess a adivinar la slopeguess .
  • Encuentra la parte del comando que dice sprite .ask y cámbiala a line .ask() .

To navigate the page using the TAB key, first press ESC to exit the code editor.

stage.set_axis(100) stage.create_grid_overlay(10, "grey") stage.set_background("soccerfield") ballx = -80 bally = random.randint(-100,100) # sprite = codesters.Sprite("image", x, y) ball = codesters.Sprite("soccerball", ballx, bally) netx = 90 nety = random.randint(-100,100) # sprite = codesters.Sprite("image", x, y) net = codesters.Sprite("soccernet", netx, nety) net.flip_right_left() #sprite = codesters.Line(x-start, y-start, x-end, y-end, "color") line = codesters.Line(ballx, bally, netx, nety, "blue")
  • Run Code
  • Enviar Trabajo
  • Actividad Siguiente
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)