def findSongs(jukeBox):
search = input('Enter a word you want to search in the dataset:')
cnt=0
for artist in jukeBox:
artist = artist.strip().split(',')
if search.lower() in ''.join(artist).lower():
cnt+=1
print('\n\nFound' , cnt, 'matches:\n------------------------\n')
for artist in jukeBox:
artist = artist.strip().split(',')
if search.lower() in ''.join(artist).lower():
printSong(artist[0],artist[1],artist[2],artist[3])
I have code that will search a list for terminal input, I would like to store the matching data to a list so that I do not have to search once to get a count and search again to print.