Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://docs.python.org/2/library/exceptions.html#exceptions.SyntaxError" rel="nofollow">SyntaxError</a> is raised by parser when it founds that your syntax is not correct, like missing colons, parenthesis, invalid statements etc. It'll not allow you to execute your code until you don't fix that the issue.</p> <p>Your code will throw only error at runtime, i.e when the function <code>tofloat(i)</code> is called for the first time, so it is a runtime error. Specifically <code>NameError</code>.</p> <p>Also a runtime error won't stop your program's execution until that buggy part is not executed. So, your code can actually run fine if you don't call <code>tofloat</code> ever.</p> <p>The code below executes properly up to third line but then stops as <code>NameError</code> is raised.(a runtime error)</p> <pre><code>print 1 print 2 print 3 print foo </code></pre> <p><strong>output:</strong></p> <pre><code>1 2 3 Traceback (most recent call last): File "so.py", line 4, in &lt;module&gt; print foo NameError: name 'foo' is not defined </code></pre> <p>This code won't execute as we made a <code>SyntaxError</code>, even though the first 3 lines are perfectly okay:</p> <pre><code>print 1 print 2 print 2 print (foo </code></pre> <p><strong>Output:</strong></p> <pre><code>$ python so.py File "so.py", line 5 ^ SyntaxError: invalid syntax </code></pre> <p>Note that there's also a <code>RunTimeError</code> in python, which is raised when an error is detected that doesn't fall in any of the other categories</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload