Using Python Write a program that reads all of the followinglist of baby names and produces two files (boys.txt) with just theboys names and girls.txt with just the girls names.
Use the code below as a guide
LIMIT = 50.0
def main() :
inputFile = open(“babynames.txt”, “r”)
boyTotal = 0.0
girlTotal = 0.0
while boyTotal < LIMIT or girlTotal < LIMIT :
# Extract the data from the next line and split it.
line = inputFile.readline()
dataFields = line.split()
# Extract the individual field values.
rank = int(dataFields[0])
boyName = dataFields[1]
boyPercent = float(dataFields[2].rstrip(“%”))
girlName = dataFields[3]
girlPercent = float(dataFields[4].rstrip(“%”))
# Process the data.
print(“%3d ” % rank, end=””)
boyTotal = processName(boyName, boyPercent, boyTotal)
girlTotal = processName(girlName, girlPercent, girlTotal)
print()
inputFile.close()
## Prints