Hi im pretty new to Python so I'm guessing im making a pretty obvious mistake here but basically what i'm trying to get my code to do here is to take in 5 products and their prices from the user, the products are working however when the user enters a price that is above 0 the message saying "Please enter a price above 0" is displayed, this is my code below, any help for a newbie is much appreciated thanks.
#Lists of products and prices
products = []
price = [] #declare lists
total = 0 #declare variable to hold total of prices
#function which is used to read in values to each list in turn
#range has been set to read in 5 values
def inputPrice():
for counter in range(0,5):
valid = False
print (counter+1, "Enter 5 Products:")
tempItems = input() #declare temp variable to hold input value
products.append(tempItems) #add this value into our list
#when reading in price if statement is added for validation
print (counter+1, "Enter their prices:")
tempCost = int(input())
if tempCost<=0: #validate input
print ("Incorrect price....")
print ("Please enter a price above 0")
else:
valid = True
price.append(tempCost)