English subtitles

← 05-04 Syntax Vs Semantics Solution

dummy description

Get Embed Code
3 Languages

Showing Revision 1 created 05/13/2012 by Amara Bot.

  1. [Narrator] 2 + 2, we're actually pretty sure this works out.
  2. There's no error for this one; it's going to evaluate to 4.
  3. Down here Mars=Earth + 1.
  4. There is actually going to be a problem here, and the problem relates to Earth,
  5. which is a variable that's used before it's being defined,
  6. and python's going to emit some sort of run-time error saying,
  7. "I don't know what Earth is so I don't know how to assign Earth + 1 to the variable Mars."
  8. This one will result in some sort of error.
  9. Over here, we assign Mars to be 4, and that's totally fine, and then we assign
  10. Mars to be Mars + 0 or another 4, so no errors here,
  11. but, finally, in this last one, we take a string, Mars, and we add an integer, 2, to it,
  12. and we don't expect addition to work on both strings and integers.
  13. This one also leads to an error.
  14. Mars is sometimes called the red planet, the fourth rock from the sun, and among other things,
  15. it features very prominently in Gustav Holst's 7 movement orchestral suite, The Planets,
  16. which was written in about 1915, worth giving a listen to if you haven't yet run into it.