Consolidation - Python riddles

Solve the following using standard Python features and built-in functions.

If possible, work in the pair programming paradigm: work in pairs, with one person taking the role of the driver (writing the code) and one taking the role of the navigator (reading and understanding the documentation). Alternate the roles. Try to find solutions that are short (i.e. few line sof code) but easy to understand.

Sum of Digits - Riddle: Write a function sum_digits(n) that takes an integer n and returns the sum of its digits. - Test it with the following test cases: sum_digits(145)-->10 and sum_digits(102)-->3

Hint: remember that you can convert an integer to a string with str(n) and a character c to integer with int(c).

Palyndrome checker

Hint: an object is a string if typ(s) returns str.

The Peak Finder

Hint: Loop through indices 0 to len(data)-1 and check neighbors carefully at the boundaries.

The Frequency Detective

Hint: Count occurrences with a dictionary, find the maximum count, then among all values with that count, return the minimum.