Bite 29. Martin's IQ test

Martin is preparing to pass an IQ test.

The most frequent task in this test is to find out which one of the given characters differs from the others. He observed that one char usually differs from the others in being alphanumeric or not.

Please help Martin! To check his answers, he needs a program to find the different one (the alphanumeric among non-alphanumerics or vice versa) among the given characters.

Complete get_index_different_char to meet this goal. It receives a chars list and returns an int index (zero-based).

Just to be clear, alphanumeric == abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789


['A', 'f', '.', 'Q', 2]  # returns index 2 (dot is non-alphanumeric among alphanumerics)
['.', '{', ' ^', '%', 'a']  # returns index 4 ('a' is alphanumeric among non-alphanumerics)

See the TESTS tab for more details

Special thanks to Martin Uribe for providing the idea and collaborating with us on this Bite!

139 out of 143 users completed this Bite.
Will you be Pythonista #140 to crack this Bite?
It takes an average of ~46 minutes to solve this Bite (submissions 5-240 min).
Pythonistas rate this Bite 3.4 on a 1-10 difficulty scale.
» You can do it! 😌

Login and get coding
We use Python 3.7