title: Returning multiple lists from Python to Java using Chaquopy
body: <p>How can I return multiple lists, values etc from my Python script to Java without ending up with a single object? Right now I end with a single PyObject with both returned values in it, and I haven't figured out how to divide them up again in Java.</p>
  <p>Python:</p>
  <pre><code>import random
  
  def calculations():
  
      res1 = [33, 13, 20, 34]
  
      list = [1,3,5,7]
      res2 = random.choices(list, k=10000)
  
      return res1, res2
  </code></pre>
  <p>Java:</p>
  <pre><code>if(!Python.isStarted())
              Python.start(new AndroidPlatform(getActivity()));
  
  Python py = Python.getInstance();
  
  
  PyObject obj = py.getModule(&quot;main&quot;).callAttr(&quot;calculations&quot;);
  
  # How to extract the different objects from obj? Tried the following without success. 
  List&lt;PyObject&gt; totList = obj.call(0).asList();
  int[] data3 = obj.call(1).toJava(int[].class);
  </code></pre>