>
> Ok making some progress by changing the 'wb' to 'w'
>

err no.


unstuck again.



import csv

csvfile= open('StudentListToSort.csv', newline='')
spamreader = csv.reader(csvfile,delimiter=',',quotechar='|')
outfile = open('outfile.csv','w')

for row in spamreader:
    
    if row[4] == '6':
        print("".join([row[0],'@email.com']),row[1])
        email = "".join([row[0],'@email.com'])
        output = email,row[1]
        outfile.write(output)

        
outfile.close()


when I start to concatenate the results, it ends up as a Tuple and the write to 
file stuff doesn't like Tuples


TypeError: must be str, not tuple



                                                  
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to