Finding the average of a list

On Python 3.4+ you can use statistics.mean() On older versions of Python you can do On Python 2 you need to convert len to a float to get float division There is no need to use reduce. It is much slower and was removed in Python 3.

Python: finding an element in a list [duplicate]

The best way is probably to use the list method .index. For the objects in the list, you can do something like: with any special processing you need. You can also use a for/in statement with enumerate(arr) Example of finding the index of an item that has value > 100. Source

Converting array to list in Java

In your example, it is because you can’t have a List of a primitive type. In other words, List<int> is not possible. You can, however, have a List<Integer> using the Integer class that wraps the int primitive. Convert your array to a List with the Arrays.asList utility method.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)