Asking for player name and age using OOP I have a text adventure game and I need to use OOP so I've chosen to use it when getting the player's name and age. I need to keep the OOP; but was wondering if there are any ways to clean up the code or simplify it while still getting the overall output.

class Player:
    def __init__(self):
        self.get_name()
        self.verify_age()

    def get_name(self):
        print(&quot;If you are ready lets begin!&quot;)
        while True:
            print(&quot;What is your name?&quot;)
            name = input(&quot;:&gt; &quot;)
            if not name.istitle():
                print(&quot;Please enter a name starting with a capital letter; try again.&quot;)
            else:
                self.name = name
                print(&quot;Hello &quot; + name + &quot; prepare for battle.&quot;)
                break

    def verify_age(self):
        while True:
            print(&quot;Before we begin please verify your age. \nWhat is your age?&quot;)
            age = input(&quot;:&gt; &quot;)
            try:
                if 8 &lt; int(age) &lt;= 110:
                    self.age = age
                    break
                elif int(age) &lt;= 8:
                    print(&quot;You are not old enough to play the game! Try again.&quot;)
                else:
                    print(&quot;You can't be that old, come on! Try again.&quot;)
            except:
                print(&quot;That is not a valid number! Try again.&quot;)
The methods in this class are not really Player methods. They are a combination of game flow, user input and value verification methods.   I'd organize it more like this.
class Game:
  def __init__(self):
    io.show(&quot;If ready, let's begin&quot;)
    name = self.get_valid_name()
    age = self.get_valid_age()
    self.player = Player(name, age)
    io.show(&quot;Hello {}, prepare for battle&quot;.format(self.player.get_name()))

The Game object owns the flow of control.  The I/O is encapsulated in an object which can be a simple stdio wrapper for now, but may eventually include non-blocking input or html output or whatever - don't tie the game logic to the display method.  The Player object contains player state.
The get_valid_x methods can basically be what you have now. If you are using that pattern over and over, you could get fancy and write a parameterized validator:
def get_valid_input(prompt, validation_func):
  while True:
    input = io.prompt(prompt)
    guidance = validation_func(input)
    if not guidance:
      return input
    io.show(guidance)

def validate_name(str):
  if not str.istitle():
    return &quot;Please enter name beginning with capital Letter&quot; 
  return None

 ...
 
 name = get_valid_input(&quot;What is your name?&quot;, validate_name)