Run the code below and read the traceback. Identify the following pieces of information about it:
\n", "SyntaxError
or an IndentationError
?def another_function\n",
" print(\"Syntax errors are annoying.\")\n",
" print(\"But at least python tells us about them!\")\n",
" print(\"So they are usually not too hard to fix.\")
\n",
"NameError
do you think this is? In other words, is it a string with no quotes, a misspelled variable, or a variable that should have been defined but was not?for number in range(10):\n",
" # use a if the number is a multiple of 3, otherwise use b\n",
" if (Number % 3) == 0:\n",
" message = message + a\n",
" else:\n",
" message = message + \"b\"\n",
"print(message)
\n",
"seasons = ['Spring', 'Summer', 'Fall', 'Winter']\n",
"print('My favorite season is ', seasons[4])
\n",
"