I'm getting a syntax error and I have no idea why when trying to print in the for loop at the bottom
NoR3gr3t (1)

import sys
namesToBeInput = int(input('How many names would you like to be input?\n'))
namesInput = 0
enteringNames = True
fname = []
lname = []
fNameInitials = []
lNameInitials = []
#Gathering Input Data
while(namesInput < namesToBeInput and enteringNames == True):
fname.insert(namesInput,str(input("Input a first name.\n")))
lname.insert(namesInput,str(input("Input a last name.\n")))
namesInput = namesInput + 1
if(namesInput == namesToBeInput):
break
print('Would you like to input another name? You have input ' + str(namesInput) + ' so far.\nYes(1) or No(2)')
answer = int(input())
if(answer == 2):
enteringNames = False
#Sorting Initials and Displaying Them
for i in range(len(fname)):
fNameInitials.append([w[0] for w in fname])
lNameInitials.append([w[0] for w in lname])
print('Initials for: ' fname[i] + ' ' + lname[i] + ' are: ' + fNameInitials[i] + lNameInitials[i])

You are viewing a single comment. View All
ash15khng (393)

1) post this in a repl
2) what errors are there