Nauč se Python > Kurzy > Beginners course PyLadies > Lists > Lists

Lists – Řešení [0]

def select_errors(listA):
    result = []
    for record in listA:
        name_surname = record.split(' ')
        name = name_surname[0]
        surname = name_surname[1]
        if name[0].islower() or surname[0].islower():
            result.append(record)
    return result

def select_correct(listA):
    result = []
    for record in listA:
        name_surname = record.split(' ')
        name = name_surname[0]
        surname = name_surname[1]
        if not name[0].islower() and not surname[0].islower():
            result.append(record)
    return result

def correct_entries(listA):
    result = []
    for record in listA:
        name_surname = record.split(' ')
        name = name_surname[0]
        surname = name_surname[1]
        result.append(name.capitalize() + ' ' + surname.capitalize())
    return result

Toto je stránka lekce z kurzu, který probíhá nebo proběhl naživo s instruktorem.