0 out of 464 challenges solved

Count Elements Before Tuple

Write a Python function `count_first_elements` that takes a tuple as input and returns the number of elements that occur before the first tuple element in the given tuple. If there is no tuple element in the input tuple, return the total number of elements in the tuple.

#### Example Usage
```python [main.nopy]
print(count_first_elements((1, 5, 7, (4, 6), 10)))  # Output: 3
print(count_first_elements((2, 9, (5, 7), 11)))     # Output: 2
print(count_first_elements((11, 15, 5, 8, (2, 3), 8)))  # Output: 4
print(count_first_elements((1, 2, 3, 4)))          # Output: 4
```

#### Constraints
- The input will always be a tuple.
- The tuple can contain any type of elements, including other tuples.
def count_first_elements(test_tup):
    """
    Count the number of elements before the first tuple element in the given tuple.

    Args:
    test_tup (tuple): The input tuple.

    Returns:
    int: The count of elements before the first tuple element.
    """
    # Iterate through the tuple and find the first tuple element
    # Replace the following line with your implementation
    pass