Write a function called "doubleElement" that takes a list as input. As output, this function should return the indices of matching elements (which will be two integers, if they exist) and return None, None otherwise. If the list contains more than 2 matches, then only the first two will be returned.
For example, doubleElement([1,2,3]) would return None, None.
doubleElement([1,2,3,1]) would return 0,3.
doubleElement([1,1,1,1]) will return 0,1. Even though there are more matching positions, only the 0th and 1st indices are returned.
Note, you can easily have a function that returns two values in Python (the below code does not have to appear in your program),
i.e. if some condition:
return index 1, index 2
else:
return None, None
Please use a for or while loop for this, and a detailed explanation of each line or lines would be greatly appreciated.