title: Scala: removing a list element by value
body: <p>I have recently started learning functional programming on a SCALA. I'm looking for help with with creating of function that take a list with 0 as argument (in the below case lst) and returns new list without 0s (newlst). Currently I created something like below Demo but it doesn't compile due to mismatch exception, any ideas how it can be fixed ? Thanks !</p>
  
  <pre><code>object Demo{
    def main(args: Array[String]) {
      val lst = List(0, 1, 2, 0, 3);
      def deletingZeros(list: List[Int]): List[Int] = {
        val newlst = list.filter(_ &gt; 0)
      }
    }
  }
  </code></pre>