title: how to solve name is not defined issue in python 3
body: <p>[enter image description here][1][How can I solve name is not defined issue, I am using python 3.6.5. I have tried using the global and many more techniques</p>
  
  <p>here'my code </p>
  
  <pre><code>import speech_recognition as sr
  import pyttsx3
  
  try:
      engine = pyttsx3.init()
  except ImportError:
      print('Requested Driver Not Found')
  except RuntimeError:
      print('Driver fails to initialize')
  
  voices = engine.getProperty('voices')
  
  for voice in voices:
      print(voice.id)
  </code></pre>
  
  <p>And the issue</p>
  
  <pre><code>"E:\Python projects\Dizzi\venv\Scripts\python.exe" "E:/Python projects/Dizzi/Dizzi.py"
  Traceback (most recent call last):
  Requested Driver Not Found
    File "E:/Python projects/Dizzi/Dizzi.py", line 12, in &lt;module&gt;
      voices = engine.getProperty('voices')
  NameError: name 'engine' is not defined
  </code></pre>
  
  <p>][2]</p>