Advertisement
fbarrocal

Untitled

Nov 20th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import csv;
  2.  
  3. // Variables
  4. csv_filename - 'example.csv'
  5.  
  6. // Functions
  7. def get_auditor_for_company(list, company):
  8.     for record in list:
  9.         if record[0] == auditor:
  10.             return record[-2];
  11.  
  12. // Main Flow
  13. company = input('digite o nome da empresa:')
  14.  
  15. with open(csv_filename) as csvfile:
  16.     csvReader = csv.reader(csvfile, delimiter=',')
  17.     auditor = get_auditor_for_company(csvReader, company);
  18.     print('Auditor:', auditor)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement