title: Python Code That Creates Username Using OOP Methods.
body: <p>I am trying to create a code using two different classes one called User that stores information about a user. The user class has Attributes of _username, _wins, _ties, and _losses. With methods of <strong>int</strong>, get_username, get_user_wins, set_user_wins, get_user_losses, set_user_losses, get_user_ties, set_user_ties,and display_user. The other class is called Users that stores and displays a user_object. Then another program that uses both classes and a menu of; [1] Create User, [2] Display Users, and [3] Exit</p>
  
  <p>I am confused on how to get this to work, the code that I have tried to write, can anyone please help me figure out how to write a code like this.</p>
  
  <pre><code>import Users
  import random
  #User Class
  class User:
      def __init__(self, username, wins, ties, losses):
          self._username = username
          self._wins = wins
          self._ties = random.randint(0,10)
          self._losses = random.randint(0,10)
      #Returns value of username field 
      def get_username(self):
          return self._username
      #Returns value of wins field
      def get_user_wins(self):
          return self._wins
      #Returns vaule of ties fied
      def get_user_ties(self):
          return self._ties
      #Returns the value of losses field
      def get_user_losses(self):
          return self._losses
      #Displays the username and stats
      def display_users(self):
          print("User List")
          print("---------")
          for user in (users.create_user()):
              print("Username: ", get_username())
              print("Wins\tTies\tLosses")   
              print(str(get_user_wins())+"\t"+str(get_user_ties())+"\t"+str(get_user_losses( )))
  
  
  
  #usersclasscode
  import User
  class Users:
      def __init__(self, user_list):
          self._user_list = []
      def create_user(self):
          username = input("Please enter the user name: ")
          wins = int(input("How many wins does "+username+" have? "))
          ties = 0
          losses = 0
          self._created_user = User.User(username, wins, ties, losses)
          self._user_list.append(self._created_user) 
          return self._user_list
  
  #usermanagercode
  import User
  import Users
  
  print("User Menu")
  print("---------")
  print("[1] Create User")
  print("[2] Display Users")
  print("[3] Exit")
  
  calc = True
  while(calc):
      a = int(input("Enter the number in bracket for what you would like to do: "))
      if a==1:
          users.create_user())        
      elif a==2:
          user.display_users(self)
      elif a==3:
          calc = False
  </code></pre>