'''
Created on Sep 11, 2013

@author: guestuser
'''
def validatePassword(password):
    """
    >>> validatePassword('CantGuessTh1s')
    True
    
    >>> validatePassword('helloThere')
    False
    
    return a boolean
    based on string parameter password
    """
    # add your code to solve the problem after this line
    # easy out: check length
    if len(password) < 8:
        return False
    # easy out: check spaces
    if password.count(' ') > 0:
        return False
    
    # check each character for at least one of 
    # either digit or capital
    digitCount = 0
    upperCount = 0
    for ch in password:
        if ch.isdigit():
            digitCount += 1
        elif ch.isupper():
            upperCount += 1

    # return True only if both were seen
    if digitCount > 0 and upperCount > 0:
        return True
    else:
        return False
    # OR:
    # return digitCount > 0 and upperCount > 0


print(validatePassword('hEllo1there'))
