title: I need to validate email using python
body: <p>The conditions for the valid emails are</p>
  <p>1.It doesn't contain spaces,</p>
  <p>2.It contains the @ symbol,</p>
  <p>3.After @, there's a dot.</p>
  <p>and Note that dots may also occur before @, and in a correct address a dot shouldn't stand immediately after @.</p>
  <p>I have tried and written the below code.</p>
  <pre><code>def check_email(string):
      a = ' ' in string
      r = 0
      if a != False:
          b = &quot;@&quot; in string
          if b == True:
              c = &quot;@.&quot; in string
              if c == True:
                  r = False
              else:
                  r = True    
          else:
              r = False    
      else:
          r = False
      return r
  a = input(&quot;Enter your email :&quot;)
  print(check_email(a))
  </code></pre>
  <p>Now i am unable to check the error.</p>
  <p>the test sample i.e</p>
  <p>My e-mail is: this@example.com</p>
  <p>Correct output:
  False</p>
  <p>My code output:
  True</p>