18 résultats trouvés
Aller à la recherche avancée
- par maths-code
- ven. sept. 29, 2023 7:49 am
- Forum : Forum 2023-2024
- Sujet : 1NSI
- Réponses : 0
- Vues : 77
Code : Tout sélectionner
from turtle import *
width(6)
def polygone(nb_cote, longueur, couleur):
color(couleur)
for i in range(nb_cote):
forward(longueur)
left(360//nb_cote)
- par maths-code
- jeu. sept. 28, 2023 7:54 am
- Forum : Forum 2023-2024
- Sujet : Algorithme de tri
- Réponses : 0
- Vues : 45
def tri_insertion(l): for i in range (len(l)): aux = l[i] k = i while k >= 1 and aux < l[k-1] > aux: l[k] = l[k-1] k = k-1 l[k] = aux L = [1, 3, 2] tri_insertion(L) def tri_selection(l): for i in range(len(l)): mini = i for j in range(i+1, len(l)): if l[mini] > l[j]: mini = j tmp = l[i] l[i] = l[mi...
- par maths-code
- jeu. sept. 21, 2023 6:44 am
- Forum : Forum 2023-2024
- Sujet : Terminale NSI
- Réponses : 2
- Vues : 1053
def indice_maxi(L): """ renvoie le maximum et les indices où se il se trouve :param L(list): :return (tuple): """ liste_maxi = [] nb_max = L[0] for i in range(len(L)): if L[i] == nb_max: liste_maxi.append(i) if L[i] > nb_max: nb_max = L[i] liste_maxi = [i] return (nb_m...
- par maths-code
- mar. sept. 19, 2023 7:39 pm
- Forum : Forum 2023-2024
- Sujet : Terminale NSI
- Réponses : 2
- Vues : 1053
def rendu_monnaie(systeme:list, montant:int)->int: """ :param system (list): système de pièces :param montant (int): somme à rendre :return nbre (int) : nombre de pièces à rendre >>> rendu_monnaie([1, 2, 5, 10], 8) 3 >>> rendu_monnaie([1, 2, 5, 10], 23) 4 >>> rendu_monnaie([1, 2, 5, ...
- par maths-code
- ven. sept. 15, 2023 11:56 am
- Forum : Forum 2023-2024
- Sujet : Terminale NSI
- Réponses : 2
- Vues : 1053
Le problème du sac à dos, stratégie 1: prendre l'objet de plus grande valeur def strat_1b(liste_objet, masse_dispo): sac = [] i = 0 while masse_dispo > 0: if liste_objet[i][1] <= masse_dispo: masse_dispo = masse_dispo-liste_objet[i][1] sac.append(liste_objet[i]) i = i + 1 return sac maison = [(9700,...
- par maths-code
- dim. juin 18, 2023 6:26 pm
- Forum : Notes techniques
- Sujet : Kwartz+Linux
- Réponses : 6
- Vues : 7245
Not always the BIOS gives you the options for TPM for granted. So on my Elitebook 8570P it is simply NOT possible to alter the TPM settings in any way. Of course you do not want the messages at the startup prompt during and in between the boot-splash. So you can do the following: In a terminal run: ...
- par maths-code
- mar. mai 16, 2023 8:47 pm
- Forum : Forum 2022-2023
- Sujet : TNSI
- Réponses : 3
- Vues : 8547
def est_cyclique(plan): ''' Prend en paramètre un dictionnaire `plan` correspondant à un plan d'envoi de messages (ici entre les personnes A, B, C, D, E, F). Renvoie True si le plan d'envoi de messages est cyclique et False sinon. ''' expediteur = 'A' destinataire = plan[ ... ] nb_destinaires = 1 w...