How to use arrays in python as a counter ?

I need to write a program in python where a dice is rolled i have to track how many times each of the six digits(1,2,3,4,5,6) are rolled.

So how do i do that ?

Respuesta :

Answer:

len is a built-in function that calls the given container object's __len__ member function to get the number of elements in the object.

Functions encased with double underscores are usually "special methods" implementing one of the standard interfaces in Python (container, number, etc). Special methods are used via syntactic sugar (object creation, container indexing and slicing, attribute access, built-in functions, etc.).

The method len() returns the number of elements in the list.

ACCESS MORE