for i in range(120):
    if i == 1 or i == 0:
        print(f'{i} は合成数でも素数でもない')
    elif i % 2 ==0 and i != 2 : 
        print(f'{i} は合成数')
    elif i % 3 == 0 and i != 3 : 
        print(f'{i} は合成数')
    elif i % 5 == 0 and i != 5 :
        print(f'{i} は合成数')
    elif i % 7 == 0 and i != 7 :
        print(f'{i} は合成数')
    else:
        print(f'{i} は素数')
    print("")

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: