title: "NameError: name is not defined" for user input
body: <p>I am new to python and made a short script to try them out, while doing so I came across and error I've never had for the particular situation before, when I try to define <code>uN</code> as a <code>str</code> inputted by the user I get:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/pi/Desktop/Scripts/classTest/classTest1.py", line 14, in &lt;module&gt;
  uN = input(str("Username"))
    File "&lt;string&gt;", line 1, in &lt;module&gt;
   NameError: name 'ben' is not defined
  </code></pre>
  
  <p>The code is as follows:</p>
  
  <pre><code>class user:
      def __init__(self, usrName, pWord):
          self.usrName = usrName
          self.pWord = pWord
  
      def createUsrPw(self):
          f = open("usrName.txt", "a")
          f.write(self.usrName)
          f.write("   ")
          f.write(self.pWord)
          f.write("\n")
          f.close()
  
  uN = input(str("Username"))
  pW = input(str("Password"))
  
  usr1 = user(uN, pW)
  
  usr1.createUsrPw()
  </code></pre>
  
  <p>I have used the <code>x = input(str())</code> syntax a lot before and never had this error, and the error traces back to line 1, so is <code>uN = input(str("Username"))</code> still being considered a part of the class?</p>
  
  <p>when I simplify the code to this it works perfectly:</p>
  
  <pre><code>class user:
      def __init__(self, usrName, pWord):
          self.usrName = usrName
          self.pWord = pWord
  
      def createUsrPw(self):
          f = open("usrName.txt", "a")
          f.write(usrName)
          f.write("   ")
          f.write(pWord)
          f.write("\n")
          f.close()
  
  
  usr1 = user("Ben", "testPw")
  
  usr1.createUsrPw()
  </code></pre>
  
  <p>with the file usrName.txt being appended to include "Ben   testPw" as intended.</p>