python-by-example-150-chall.../challenges111-117/challenge-114.py

18 lines
379 B
Python
Raw Permalink Normal View History

2019-08-04 20:26:35 +08:00
import csv
file_read = open('Books.csv', 'r')
for row in file_read:
print(row)
file_read.close()
start_year = int(input('Enter start year : '))
end_year = int(input('Enter end year : '))
tmp = []
file_read = open('Books.csv', 'r')
file_reader = csv.reader(file_read)
for row in file_reader:
if start_year < int(row[2]) < end_year:
print(row)
file_read.close()