title: How do I pass an attribute to a function in the same class?
body: <p>I am having trouble with this code. The goal is to "encrypt" a message that the user inputs by reversing the input. The lesson was originally written as a functional block of code, but I wanted to convert it to object-oriented programming and now I get an error. Please let me know if I have any other issues in this code.</p>
  
  <p>This is the code</p>
  
  <pre><code>class Encrypt:
      def __init__(self,message,translated): 
          self.message = message # user input
          self.translated = translated # encrypted result
  
      def encryptionProcess(self,message): # encrypting functino 
          i = len(message) - 1
          while i &gt;= 0:
              self.translated = self.translated + self.message[i]
              i = i - 1
  
  m1 = Encrypt(input(),'') # setting the class attributes
  m1.encryptionProcess(message) # calling the function
  print(Encrypt.translated) # printing the result
  </code></pre>
  
  <p>This is the error</p>
  
  <pre><code>Traceback (most recent call last):
    File "oopEncrypt.py", line 13, in &lt;module&gt;
      m1.encryptionProcess(message)
  NameError: name 'message' is not defined
  </code></pre>