# get player's name from the user
# get the number of homeruns so far
# get the number of games played so far

GAMES_IN_SEASON = 162
##'PeteAlonso,1B,NYM,22,68\n'

infile = open('homeruns.txt', 'r')

for aline in infile:
    aline = aline.strip() # this removes \n at the end
    datalist = aline.split(',')
    player_name = datalist[0]
    homeruns_sofar = int(datalist[3])
    games_sofar = int(datalist[4])
    
    projected_homeruns = round(homeruns_sofar * GAMES_IN_SEASON / games_sofar)

    # homers so far * 162 / games played so far

    # player’s name is projected to hit number home runs in 162 games.

    print(player_name, 'is projected to hit', projected_homeruns, 'homeruns in', GAMES_IN_SEASON, 'games.')

    if projected_homeruns > 73:
        print(player_name + ' is projected to break the major league season home run record.')


infile.close()
