How to generate Object with FOR loop?

Solution
listStocks = DB.execute("SELECT * FROM cars WHERE id_user = ?", userId)
car_details = [ {'brand': item["brand"], 'model': item["model"] } for item in listStocks ]
return render_template('index.html', car=car_details)