title: Python 3.X reading null values from a table
body: <p>let's assume that I have a resultset with a couple of fields. Now one of these fields is coming as 'NULL' or in Python language None. Now I need to create a method to replace whole Nones in a field by a specific word example 'UNKNOWN'. Here is my method.</p>
  
  <pre><code>def definegender(x):
      if x is not None:
        return x
      else:
          x = 'unknown'
          return x
  </code></pre>
  
  <p>Now testing</p>
  
  <pre><code>z= None
  definegender(z)
  print('{}'.format(z))
  </code></pre>
  
  <p>Unfortunately, my approach does not work, please can you guys let me know the best way to create this validation. Thanks </p>