How many products have discount % greater than 30%? On pymongo (MongoDB driver library for Python), I have
original_price
[store as float] andsale_price
[store as float]
in mongoDB, I am using:
# question 10:-How many products have discount % greater than 30%?
count=0
for x in db.leclerc_fr.find():
if((x['sale_price']/x['original_price']<.7)):
print(x)
count+=1
print(count)