Question: I want to create a HashMap to store data to firestore database. I want store the name and a boolean value based on the pressed button. But the **"put()"** in hashmap **replaces** the previous values, i.e the name and the boolean value. And i get only the last value in the database.

Here is the use of put to store data in the Map.

```
   @Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.present:
            attendance.put(name, true);
            nextCard();
            break;

        case R.id.absent:
            attendance.put(name, false);
            nextCard();
            break;
    }
}

```

And the firestore store method..

```
public void storeAttendance(String batch) {
    String date = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(new Date());

    db.collection(batch+"sheet").document(date)
            .set(attendance)
            .addOnSuccessListener(new OnSuccessListener<Void>() {
                @Override
                public void onSuccess(Void aVoid) {
                    Log.d("TAG", "DocumentSnapshot successfully written!");
                }
            })
            .addOnFailureListener(new OnFailureListener() {
                @Override
                public void onFailure(@NonNull Exception e) {
                    Log.w("TAG", "Error writing document", e);
                }
            });
}

```

I want the values for all the students attendance in the database but i get only the single value for the last student.

[The Database structure i get.](https://i.stack.imgur.com/Q7Ixg.png)

Answer: 
Try and identify what makes a number even. In your head, what could you do to the number to prove it is even? You divide it by 2 and see if the remainder is 0. In programming, we use the modulo operator (%) to get the remainder of an equation. 

Try and think of a way that you can iterate over the items in your list and see if they are even using the above method.
You can use the Python builtin function which name is any(). here is my code which will check if your list have any even number. You will get true value if there is any even number in your list otherwise it will return false.

```
list1 = [3,105,97,17,68241,5,3,8,]
print(any(num%2 == 0 for num in list1))

```