First names

Dessign the function @primers_noms(f, n)@ that returns a list of male nouns. Function parameters are a list of strings ff and a non negative integer nn. The result list must contain the first nn male nouns in ff. If there are less than nn male nouns the function must return a list with those male nouns and at the end the string ’i cap mes’.

def es_nom_de_noi(s):
    return s in ['Albert', 'Antoni', 'Lluis', 'Marc', 
                 'Pere', 'Pol', 'Ramon']

Sample session

Problem information

Author: InfBesos

Generation: 2026-01-25T14:08:49.907Z

© Jutge.org, 2006–2026.
https://jutge.org