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.
import re
def is_lucky(ticket):
    return bool(re.match(r'\d{6}', ticket)) and sum(int(i) for i in ticket[:3]) == sum(int(i) for i in ticket[3:])
import re
def is_lucky(ticket):
    return bool(re.match(r'\d{6}', ticket)) and sum(int(i) for i in ticket[:3]) == sum(int(i) for i in ticket[3:])