Counting

Report a typo

We have the database which contains more than a thousand objects for the Car model:

class Car(models.Model):
    color = models.CharField(max_length=32)

Count the number of red cars in our database using the method that uses the least amount of memory.

Write a program in Python 3
number_of_cars = ...
___

Create a free account to access the full topic