title: How to create a function that takes in a list as input and returns a 1 for each value that is above 0.5 and a 0 if below 0.5?
body: <p>I have a float list that I want to convert to a list containing 1 or 0 for each individual value depending on if they are greater than a certain value.</p>
  <p>Example:</p>
  <pre><code>list=[0.4,0.6,0.7,0.3,0.2,0.7,0.8]
  
  value=0.5
  </code></pre>
  <p>for each item in the list I want to change values greater than 0.5 to a 1 and values less than that to a 0.</p>
  <p>I have tried this but keep getting a NoneType object which I won't be able to use in calculations later on.</p>
  <pre><code>    def fun1(list,value):
              for i in list:
                      if i &gt; value
                              print(int(1))
                      if i &lt; value
                              print(int(0))
  </code></pre>
  <p>I get the right numbers in the list [0,1,1,0,0,1,1]; however, it says the type is None. I want them to be integer values in the list so I can use them for computations later. What could I be doing wrong? Any suggestions?</p>