title: Spark rdd write in global list
body: <p>How to write in global list with rdd?</p>
  
  <pre><code> Li = []
  
   Fn(list):        
      If list.value == 4: 
          Li.append(1)
   rdd.mapValues(lambda x:fn(x))
  </code></pre>
  
  <p>When I try to print Li the result is: []</p>
  
  <p>What I'm trying to do is to transform another global liste Li1 while transforming the rdd object. However, when I do this I have always an empty list in the end. Li1 is never transformed. </p>