<file_sep>from typing import List

if __name__ == "__main__":
    nbr_entier = int(input("Entrez un entier strictement positif: "))
    nbr_list: List[int] = []
    nbr = 1
    while nbr < nbr_entier:
        nbr = nbr + 1
        if nbr_entier % nbr == 0:
            nbr_list.append(nbr)
    nbr_list.pop(len(nbr_list) - 1)

    if len(nbr_list) > 0:
        print("Diviseur propre sans répétition de", nbr_entier, ": ", nbr_list)
        print("il a ", len(nbr_list), " diviseurs propres")
    else:
        print("Diviseur propre sans répétition de", nbr_entier, ": aucun")
        print("il est deja premier!")
<file_sep>import turtle as tt


def forme(turtle=tt, long_base=5, angle=0, cote=3):
    turtle.right(angle)
    for x in range(cote):
        turtle.forward(long_base)
        turtle.right(-360 / cote)


def move(turtle=tt, x=None, y=None):
    turtle.up()
    if x is None:
        x = turtle.pos()[0]
    if y is None:
        y = turtle.pos()[1]
    turtle.setposition(x, y)
    turtle.down()


if __name__ == "__main__":

    pen = tt.Turtle()
    pen.width(5)
    pen.speed(40)
    pen.color('gray')
    move(pen, -400, -300)
    pen.forward(800)
    move(pen, 350, -300)
    pen.color('brown')
    pen.left(90)
    pen.forward(450)

    pen.color('green')
    for x in range(0, 6):
        forme(turtle=pen, long_base=80, angle=(-60), cote=3)

    pen.color('brown')
    move(pen, 350, -180)
    pen.right(-70)
    pen.forward(120)

    pen.color('green')
    for x in range(0, 6):
        forme(turtle=pen, long_base=60, angle=(-60), cote=3)

    pen.color('brown')
    move(pen, 350, -50)
    pen.forward(120)
    pen.color('green')
    for x in range(0, 6):
        forme(turtle=pen, long_base=60, angle=(-60), cote=3)

    pen.right(70)

    pen.color('cyan')
    move(pen, -250, 200)
    for x in range(0, 6):
        forme(turtle=pen, long_base=40, angle=(-60), cote=3)

    move(pen, -150, 120)
    for x in range(0, 6):
        forme(turtle=pen, long_base=40, angle=(-60), cote=3)

    move(pen, -100, 230)
    for x in range(0, 6):
        forme(turtle=pen, long_base=40, angle=(-60), cote=3)

    move(pen, 0, 130)
    for x in range(0, 6):
        forme(turtle=pen, long_base=40, angle=(-60), cote=3)

    move(pen, 50, 240)
    for x in range(0, 6):
        forme(turtle=pen, long_base=40, angle=(-60), cote=3)

    pen.color("yellow")
    move(pen, -300, -260)
    for x in range(0, 6):
        forme(turtle=pen, long_base=40, angle=(-60), cote=3)

    pen.color("orange")
    pen.right(35)
    pen.forward(60)
    pen.left(35)
    guidon = pen.pos()

    pen.color("yellow")
    move(pen, -176, -260)
    for x in range(0, 6):
        forme(turtle=pen, long_base=40, angle=(-60), cote=3)

    pen.color("orange")
    move(pen, -206, -210)
    pen.right(-30)
    for x in range(0, 2):
        forme(turtle=pen, long_base=60, angle=-60, cote=3)

    pen.color("red")
    pen.right(-160)
    pen.forward(25)

    pen.right(40)
    pen.backward(25)
    move(pen, guidon[0], guidon[1])
    pen.left(40)
    pen.forward(25)

    pen.ht()

    tt.done()
<file_sep>import numpy as np

if __name__ == "__main__":
    rayon = float(input("Rayon: "))
    hauteur = float(input("hauteur: "))

    volume = 1/3 * np.pi * rayon**2 * hauteur

    print("le volume est: ", volume)
<file_sep>import random as rd

def validator(str="atg"):
    nbr_str = 0

    for n in str:
        for verf in "atgc":
            if n == verf:
                nbr_str = nbr_str + 1
    if len(str) == nbr_str:
        return True
    else:
        return False

def randomSaisie():
    list_atcg = "atgc"
    output = ""
    for e in range(rd.randrange(8,450)):
        for i in range(rd.randrange(0, 5)):
            output = output + list_atcg[i]
    return  output





if __name__ == "__main__":
    str = randomSaisie()
    print(str)
    valid = validator(str)

    if valid:
        print("chaine valide")
    else:
        print("chaine invalide")

    print("{0:.2f}".format(1.35555533), "test")<file_sep>if __name__ == "__main__":

    hauteur = int(input("Taille du sapin:\nhauteur:"))
    branche = ['^']
    space = ' '

    for y in range(0, hauteur - 1):
        branche.append('^' + branche[y] + '^')
        print(int(hauteur-y)*space + branche[y])
<file_sep>import turtle as tt

def forme(turtle=tt, long_base=5, angle=0, cote=3 ):
    turtle.right(angle)
    for x in range(cote):
        turtle.forward(long_base)
        turtle.right(-360/cote)

def move(turtle=tt, x=None, y=None):
    turtle.up()
    if x is None:
        x = turtle.pos()[0]
    if y is None:
        y = turtle.pos()[1]
    turtle.setposition(x, y)
    turtle.down()

if __name__ == "__main__":

    pen = tt.Turtle()
    pen.color('red')
    pen.width(3)
    move(pen, 20)
    forme(turtle=pen, long_base=40, angle=0, cote=4)
    pen.color('green')
    move(pen, 0, 80)
    forme(turtle=pen, long_base=80, angle=0, cote=3)
    move(pen, 0,0)
    pen.color('black')
    forme(turtle=pen, long_base=80, angle=0, cote=4)

    tt.mainloop()
