def two_conditions(s: str) -> int:
    """Return the first index of s which is a digit, 
    as long as an uppercase 
    letter had appeared before getting to this index.
    Return -1 if no index satisfies both conditions.
    
    Use a while loop with appropriate conditions.  
    Consider creating a variable that can tell you if 
    you've seen an uppercase letter yet.
    
    >>> two_conditions('aB1cd')
    2
    >>> two_conditions('Aaaaaaaaaaaaaaaaaaaaaaaaaaaaa1aaa')
    
    >>> two_conditions('ab1cd')
    -1
    >>> two_conditions('Hello7')
    5
    >>> two_conditions('abcd')
    -1
    """
    ## We will use a while loop, which requires some conditions
    
    
    # We haven't yet seen an uppercase letter
    #we need a variable to hold this information (boolean)
    
    ## which conditions should be true such that we continue looping?
    # WHILE we haven't reached the end of the string
    #    AND we have 
    #    NOT [reached a digit AND seen an uppercase letter yet]
        #  (inside the while loop body)
        # If we see an uppercase letter
            # Remember this information
            # (remember means save to a variable)
        
        #  Move on to the next character
      
    # If we have reached the end of the string without meeting the conditions
        # RETURN -1
        
    # RETURN the index of the character in the string
        
    
    
    
    
    