in my program i ask the user for a number and then proceed to read a csv file using DictReader. I want to output the values in the csv file that are larger then the users number....
import csv
limit_amount = raw_input("Please Enter a Limit Amount: ")
with open("transactionsample.csv","rb") as my_file:
reader = csv.DictReader(my_file)
for row in reader:
print row
What you want to do is to test the value from you
row
you are reading against the user inputlimit_amount
. For that you need to know which 'column' you're comparing the user input against, let's say the value you're looking for is at index2
: