def player_1_turn(num_balls):
    """
    This function asks the user to choose how many balls to take and subtracts that number from the total number of balls.
    :param num_balls: integer. number of balls that changes as user and computer pick
    :return: updated number of balls.
    """

    player1 = int(input("How many balls do you wanna take? Please choose from 1 to 4:"))              # ask user to choose how many balls to take from 1 to 4
    list = (1,2,3,4)                                                                           # list of possible ball choices to pick
    while player1 not in list:                                                     # while loop to prevent user from choosing something else
        player1 = int(input("Not an option, try again"))                           # print statement to tell them to input another number of balls
    num_balls = num_balls - player1                                                # subtraction of user's pick from total number of balls
    print("you took", player1, "balls")                                            # telling user how many balls they pick
    print("there are", num_balls, "left")                                          # telling user how many balls are remaining
    return num_balls