userfile py program to create file of usernames in batch mode def main()print("this program creates file of usernames from "print("file of names "get the file names infilename input("what file are the names in"outfilename input("what file should the usernames go in"open the files infile open(infilename" "outfile open(outfilename" "process each line of the input file for line in infileget the first and last names from line firstlast line split(create the username uname (first[ ]+last[: ]lower(write it to the output file print(unamefile=outfileclose both files infile close(outfile close(print("usernames have been written to"outfilenamemain(there are couple things worth noticing in this program have two files open at the same timeone for input (infileand one for output (outfileit' not unusual for program to operate on several files simultaneously alsowhen creating the usernamei used the lower string method notice that the method is applied to the string that results from the concatenation this ensures that the username is all lower caseeven if the input names are mixed case summary this has covered important elements of the python typesstringslistsand files here is summary of the highlights