title: SageMathCloud: Error: unexpected EOF while parsing
body: <p>In a Sage worksheet (.sagews file) in SageMathCloud, this code:</p>
  
  <pre><code>def elgamal_encrypt ( pub_key ,g ,p , message ):
  k = floor ( 1+( p -2)* random ())
  return ( Mod (g , p )^ k , message * Mod ( pub_key ^k , p ) )
  </code></pre>
  
  <p>produces the error:</p>
  
  <pre><code>Error in lines 1-1
  
  Traceback (most recent call last):
    File "/projects/7870d70a-93d1-44f4-bce4-990a540707b7/.sagemathcloud/sage_server.py", line 879, in execute
      exec compile(block+'\n', '', 'single') in namespace, locals
  
    File "&lt;string&gt;", line 1
  
      def elgamal_encrypt ( pub_key ,g ,p , message ):
                                                     ^
  SyntaxError: unexpected EOF while parsing
  </code></pre>
  
  <p>How can this be corrected?</p>