Hello, I need your help in designing a function. I have created this script to check out if certain column in some csv files has value "0":
import csv def zerofound(csvfile, outputfile, lastcolumn ): """Finds columns with zero prices. Column have 0 index""" final = csv.writer(open(outputfile, 'wb'), dialect='excel') reader = csv.reader(open(csvfile, 'rb'), dialect='excel') for row in reader: if '0' in row[:lastcolumn]: final.writerow(row) if __name__ == '__main__': zerofound('pricesfrombv.csv', 'noprices_in_BV.csv', 4) zerofound('excelbv.csv', 'noprices_in_ExcelBV.csv', 6) My question is. Is it OK to create functions with no "returns"? Basically what I did resembles a subroutine, right? How could I redesign this to use "return"? Thanks for your input, Eduardo _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor