#!/usr/bin/env python
# -*- coding: utf-8 -*-


from typing import List


def convert_to_absolute(number: float) -> float:
    return number if number > 0 else -number


def use_prefixes() -> List[str]:
    prefixes, suffixe = 'JKLMNOPQ', 'ack'
    output = []
    for letter in prefixes:
        output.append(letter + suffixe)
    return output


def prime_integer_summation() -> int:
    output = 0
    evaluatedNumber = 2
    counter = 0
    while counter < 100:
        if(is_prime_number(evaluatedNumber)):
            output += evaluatedNumber
            counter += 1
        evaluatedNumber +=1

    return output

def is_prime_number(number: int):
    if number > 1:
        for i in range(2, number):
            if (number % i) == 0:
                return False

    return True            

def factorial(number: int) -> int:
    output = 1
    for i in range(1,number):
        output *= i
    return output


def use_continue() -> None:
    for i in range(1,11):
        if(i != 5):
            print(str(i))
        else:
            continue


def verify_ages(groups: List[List[int]]) -> List[bool]:
    output = []
    for group in groups:
        if(is_group_acceptable(group)):
            output.append(True)
        else:
            output.append(False)

    return output

def is_group_acceptable(group: List[int]) -> bool:
    someone_older_than_seventy = False
    someone_is_fifty = False
        
    for member_age in group:
        if(member_age == 25):
            return True
        elif (member_age < 18):
            return False
        elif(member_age == 50):
            someone_is_fifty = True
        elif(member_age > 70):
            someone_older_than_seventy = True
    
    if(someone_older_than_seventy and someone_is_fifty):
        return False
    if(len(group) > 10 or len(group) <=3):
        return False
    
    return True


def main() -> None:
    number = -4.325
    print(f"La valeur absolue du nombre {number} est {convert_to_absolute(number)}")

    print(f"La liste des noms générés avec les préfixes est: {use_prefixes()}")

    print(f"La somme des 100 premiers nombre premier est : {prime_integer_summation()}")

    number = 10
    print(f"La factiorelle du nombre {number} est: {factorial(number)}")
    
    print(f"L'affichage de la boucle est:")
    use_continue()

    groups = [
        [15, 28, 65, 70, 72], [18, 24, 22, 50, 70], [25, 2],
              [20, 22, 23, 24, 18, 75, 51, 49, 100, 18, 20, 20], [70, 50, 26, 28], [75, 50, 18, 25],
              [13, 25, 80, 15], [20, 30, 40, 50, 60], [75, 50, 100, 28]
    ]
    print(f"Les différents groupes sont: {groups}")
    print(f"L'acceptance des groupes est: {verify_ages(groups)}")


if __name__ == '__main__':
    main()
