PASO 5: ¡Es hora de intentar lanzar un hechizo! Tendremos que empezar a llamar funciones para verlas funcionar.

  • Desde , arrastre Function Call with Parameter a la parte inferior de la sección MAIN CODE .
  • Cambie my_function a cast_spell . Cambie el parámetro entre paréntesis de my_var a player .

Necesitamos pasar un argumento a cast_spell() porque su definición de función incluye un parámetro llamado caster . Pasar player a esta función le permite determinar quién está lanzando un hechizo, el player o la computer .

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

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Enviar Trabajo
  • Actividad Siguiente
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)