PASO 8: ¡Terminemos la función add() !

  • Desde drop Addition con sangría dentro de la función add() .
  • Cambie el nombre de la variable de my_var a total . Cambie el 2 a num_1 y el 3 a num_2 .
  • De GRÁFICOS añadir Say . Cambie la cadena a "The sum is " + str( total ) .

Estamos usando la concatenación de cadenas para unir "The sum is " y total . ¡ str() convierte total de un flotante en una cadena!

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)