title: "AttributeError: 'list' object has no attribute 'SMSMessage'"
body: <p>I have tried many ways but can't seem to get the length of my list through the method in my class my code:</p>
  
  <pre><code>SMSStore = []
  unreadMessage = []
  class SMSMessage(object):
  
      def __init__(self, hasBeenRead, messageText, fromNumber):
          self.hasBeenRead = hasBeenRead
          self.messageText = messageText
          self.fromNumber = fromNumber
          hasBeenRead = False
  
      def markAsRead(self, hasBeenRead):
          hasBeenRead = True
  
      def add_sms(self):
          newMessage = (self.hasBeenRead, self.messageText, self.fromNumber)
          return SMSStore.append(newMessage)
  
      def get_count():
          return len(SMSStore)
  
      def get_message(self, i):
          hasBeenRead = True
          return SMSStore[i][1]
  
      def get_unread_messages(i):
          for i in SMSStore:
              if SMSStore[i][0] == False:
                  unreadMessage.append(SMSStore[i])
          print unreadMessage
  
      def remove(self, i):
          return SMSStore.remove(i)      
  </code></pre>
  
  <p>This is how a message in the list would ideally look like:</p>
  
  <pre><code>#sample = SMSMessage(False, "Hello friend!", 0742017560)
  </code></pre>
  
  <p>And here is how the class is used</p>
  
  <pre><code>userChoice = ""
  
  while userChoice != "quit":
      userChoice = raw_input("What would you like to do - read/send/quit?")
      if userChoice == "read":
          print len(SMSStore)#this way i can get the length of the list anyway without using get_count
          SMSStore(get_count()
  
          unreadChoice = raw_input("Would you like to retrieve all unread messages or one of your own choice? - all unread/custom  ")
          if unreadChoice == "custom":                
              i = int(raw_input("Please enter which message number you want to read: "))
              print get_message(i)  #I dont understand how i works and how to get it working with the object definition
  
      elif userChoice == "send":
          messageText = raw_input("Please type in your message: ")
          fromNumber = raw_input("Please type in the number it was sent from ")
          newObject = SMSMessage(False, messageText, fromNumber)
          newObject.add_sms()
  
          print SMSStore
  
      elif userChoice == "quit":
          print "Goodbye"
  
      else:
          print "Oops - incorrect input"
  </code></pre>
  
  <p>I can just use <code>len(SMSStore)</code> but I want to be able to use the method inside the class to get it. Can point out any mistakes?</p>
  
  <p>This was the question asked:</p>
  
  <pre><code>Open the file called​  sms.py​
  Create a class definition for an SMSMessage which has three variables:
      hasBeenRead, messageText, and fromNumber.  
  The constructor should initialise the sender’s number. 
  The constructor should also initialise hasBeenRead  to false
  Create a method in this class called MarkAsRead which should change hasBeenRead to true.
  Create a list called SMSStore to be used as the inbox.
  
  Then create the following methods:
  add_sms - which takes in the text and number from the received sms to
            make a new SMSMessage object. 
  get_count - returns the number of messages in the store.
  get_message - returns the text of a message in the list.Forthis, allow the
                user to input an index i.e. GetMessage(i) returns the message
                stored at position i in the list. Once this has been done,
                hasBeenRead should now be true. 
  get_unread_messages - should return a list of all the messages which
                        haven’t been read. 
  remove - removes a message in the SMSStore. 
  Now that you have these set up, let’s get everything working!  
  </code></pre>