/**
 * This exercise focuses on finding the intersection of 'less than' and 'string formatting' concepts.
 * Given the first and last name of an actor/actress, the task is to check if the total number of characters in their name is less than 10.
 * If it is, the solution should return the name formatted as "LastName, FirstName"; otherwise, return their full name with a message indicating that it is too long.
 * Note: The function is case sensitive and considers every character in the name, including spaces.
 *
 * @param prenom The first name of the actor/actress.
 * @param nom The last name of the actor/actress.
 * @return The formatted name or an informative message about the length.
 *
 * Examples:
 * name("Tom", "Hanks") => "Hanks, Tom"
 * name("Johnny", "Depp") => "Johnny Depp's full name is too long!"
 */
fun name(prenom: String, nom: String): String {

    val nameLength = prenom.length + nom.length  // Calculate the total length of the name

    return if (nameLength < 10) {
        "${nom}, ${prenom}"  // Format name as "LastName, FirstName"
    } else {
        "$prenom $nom's full name is too long!"
    }
}
/**
 * This exercise focuses on finding the intersection of 'less than' and 'string formatting' concepts.
 * Given the first and last name of an actor/actress, the task is to check if the total number of characters in their name is less than 10.
 * If it is, the solution should return the name formatted as "LastName, FirstName"; otherwise, return their full name with a message indicating that it is too long.
 * Note: The function is case sensitive and considers every character in the name, including spaces.
 *
 * @param prenom The first name of the actor/actress.
 * @param nom The last name of the actor/actress.
 * @return The formatted name or an informative message about the length.
 *
 * Examples:
 * name("Tom", "Hanks") => "Hanks, Tom"
 * name("Johnny", "Depp") => "Johnny Depp's full name is too long!"
 */
fun name(prenom: String, nom: String): String {
/**
 * This exercise focuses on finding the intersection of 'less than' and 'string formatting' concepts.
 * Given the first and last name of an actor/actress, the task is to check if the total number of characters in their name is less than 10.
 * If it is, the solution should return the name formatted as "LastName, FirstName"; otherwise, return their full name with a message indicating that it is too long.
 * Note: The function is case sensitive and considers every character in the name, including spaces.
 *
 * @param prenom The first name of the actor/actress.
 * @param nom The last name of the actor/actress.
 * @return The formatted name or an informative message about the length.
 *
 * Examples:
 * name("Tom", "Hanks") => "Hanks, Tom"
 * name("Johnny", "Depp") => "Johnny Depp's full name is too long!"
 */
fun name(prenom: String, nom: String): String {

    val nameLength = prenom.length + nom.length  // Calculate the total length of the name

    return if (nameLength < 10) {
        "${nom}, ${prenom}"  // Format name as "LastName, FirstName"
    } else {
        "$prenom $nom's full name is too long!"
    }
}