I'm not a Python expert too but I don't that return statement can be used
as is on the fly.
So, yes is the expected behavior of Python

Try instead

#+begin_src python :results output
  a = (1, 2, 3, 4)
  print(a)
#+end_src

#+RESULTS:
: (1, 2, 3, 4)



On Fri, Jan 31, 2014 at 9:24 PM, Soapy Smith <soapy-sm...@comcast.net>wrote:

> Hello-
>
> I am not a user of Python (yet).  During a comparison of code block
> behavior between Clojure and Python, I discovered a possible Python
> error.
>
> Here is the code block:
>
> #+begin_src python :results output
>  a = (1, 2, 3, 4)
>  return a
> #+end_src
>
> The evaluation of this block results in this error:
>
>   File "<stdin>", line 2
> SyntaxError: 'return' outside function
>
> Could someone please comment if this is expected Python behavior?
>
> I am using org 8.2.4.
>
> Regards,
> Greg
>
>
>


-- 
Ahmadou H. DICKO
statistician economist (Ingénieur Statisticien Économiste)
PhD candidate in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated Land
Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
email : ahmadou.di...@ucad.edu.sn
twitter : @dickoah
github : github/dickoa <https://github.com/dickoa>
tel : +221 33 827 55 16
portable: +221 77 123 81 69

Reply via email to