#!/usr/bin/env python

"""
The Player class of the application represents the player of the game.
"""


class Player:

    def __init__(self, first_name = None, last_name = None, numbers = None):
        """
        Initiate the player instance.
        The first name, last name and numbers can be provided as arguments here,
        or by the user input calling the from_input method.

        :param first_name (str) (default: None): first name of the player.
        :param last_name (str) (default: None): last name of the player.
        :param numbers (list) (default: None): favorite numbers of the player
                                including the white ball numbers and power ball numbers.
        """

        self.first_name = first_name
        self.last_name = last_name

        # accept the numbers if it's a list, otherwise create a new list.

        if numbers and isinstance(numbers, list):
            self.numbers = numbers
        else:
            self.numbers = list()

    @staticmethod
    def _get_name(name_type):
        """
        Get the name of name_type from the user and verify.

        :param name_type (str): The type of name - 'first' or 'last' - to be used in prompt.

        :return (str): valid user entered name.
        """

        name = ''

        # while the user entered name is not valid, ask for the name.

        while not name:
            name = input("Enter your {} name: ".format(name_type)).strip()

            if not name:
                print("Invalid {} name. Please try again.".format(name_type))

        return name



@@ -1582,9 +1582,1760 @@
 n name%0A%0A
+    @staticmethod%0A    def _get_numbers():%0A        %22%22%22%0A        Get the six favorite numbers from the user and verify.%0A%0A        :return (list): list of valid numbers entered by user.%0A        %22%22%22%0A%0A        numbers = list()%0A%0A        # dictionary of the number input prompts based on - which numbered ball, valid range and exclude list.%0A%0A        display_dict = dict(%5B(1, %22Select 1st # (1 thru 69): %22),%0A                             (2, %22Select 2nd # (1 thru 69 excluding %7B%7D): %22),%0A                             (3, %22Select 3rd # (1 thru 69 excluding %7B%7D and %7B%7D): %22),%0A                             (4, %22Select 4th # (1 thru 69 excluding %7B%7D, %7B%7D, and %7B%7D): %22),%0A                             (5, %22Select 5th # (1 thru 69 excluding %7B%7D, %7B%7D, %7B%7D, and %7B%7D): %22),%0A                             (6, %22Select Power Ball # (1 thru 26): %22)%5D)%0A%0A        # get six numbers by asking user for next number and validate each number before adding to final list.%0A%0A        for i in range(1, 7):%0A%0A            valid = False%0A%0A            # ask for current number till a valid number is not entered.%0A%0A            while not valid:%0A%0A                display_string = display_dict%5Bi%5D.format(*numbers)%0A%0A                # if number is not a numeric, raise ValueError.%0A                # if numeric, check for validity.%0A%0A                try:%0A                    next_number = int(input(display_string))%0A                    valid = Player.is_valid_number(next_number, numbers)%0A%0A                    if not valid:%0A                        print(%22Number not allowed. Please try again.%22)%0A%0A                except ValueError:%0A                    print(%22Invalid input. Please try again.%22)%0A%0A            # a valid number is added to the numbers list.%0A%0A            numbers.append(next_number)%0A%0A        return numbers
 %0A

add get_numbers method.