Solve in Python:
In Russia regular bus tickets usually consist of 6 digits. The ticket is called lucky when the sum of the first three digits equals to the sum of the last three digits. Write a function to find out whether the ticket is lucky or not. Return true if so, otherwise return false. Consider that input is always a string. Watch examples below.
def is_lucky(ticket):
    try:
        if ticket == '':
            return False
        else:
            idk = [int(x) for x in ticket]
            first = sum(idk[0:3])
            second = sum(idk[3:6])
            if first == second:
                return True
            else:
                return False
    except:
        return False