title: Using sha256 to hash a variable in Python
body: <p>I am having trouble using sha256 hash for a variable. Here is my code:</p>
  <pre><code>var = 'password'
  hashedWord = sha256(b var).hexdigest()
  print(hashedWord)
  </code></pre>
  <p>I know it would be easier to do this:</p>
  <pre><code>hashedWord = sha256(b'password').hexdigest()
  print(hashedWord)
  </code></pre>
  <p>But I don't want to do it that way. Can anyone help?</p>