Shaare your links...
59 links
IamBob Home Login RSS Feed ATOM Feed Tag cloud Picture wall Daily
Links per page: 20 50 100
◄Older
page 1 / 3
  • Fiche Tp
    Dosage par ethalonage =
    Thu 10 Sep 2020 04:17:45 PM CEST - permalink -
    - http://physique
  • PHP
    <?php
    // Test de l’envoi du formulaire
    // L’alternative sera la présentation du formulaire
    // si la méthode GET est employéeif(!empty($_POST))
    {  
    if (!empty($_POST['login']) && !empty($_POST['password']))
    // Sont-ils ceux attendus ?
    if ($_POST['login'] != 'root'){
    { $errorMessage = 'Mauvais login !';
    }
    elseif ($_POST['password'] != '4242'){
    $errorMessage = 'Mauvais password !';
    }
      else {
    //suite.php en transmettant en paramètre
    header('Location: suite.php?login='.$_POST['login']);
    }
    }
    else{ $errorMessage = 'Veuillez insrire vos indentifiants svp !';
    }
    }
    ?>
    <!DOCTYPE html>
    <html>
    <body>
    <?php
    if (!empty($errorMessage)) echo $errorMessage;
    ?>
    <form action="authentification.php" method="post">
    <fieldset>
    <legent> identifiez-vous</legent>
    <label for="login">Login :</label>
     <input type="text" name="login" placeholder="bob" pattern=[a-z]{2,} required />
     <label for="password">Password :</label>
     <input type="password" name="password"/>
     <input type="submit" value="Se loguer"/>
    </fieldset>
    </form>
    </body>
    </html
    Tue 11 Feb 2020 05:34:32 PM CET - permalink -
    - http://l
    lycee
  • Filius
    Filius logiciel réseaux d'apprentissage
    Fri 31 Jan 2020 08:32:30 AM CET - permalink -
    - http://logiciel
  • Javascript
    /* nom du fichier : script.je */
    function valiform() {
    let error=false;
    let textError;

    if(document.forms[myFrom]["nom"].value=""){
    error=true;
    textError="Erreur: veuillez remplir le champ Nom";
    }
    if(document.forms[myForm]["tel"].value.length!=0){
    error=true;
    textEroor="Erreur: veuillez remplur le champ Téléphone"
    }
    return !error;
    }
    Tue 14 Jan 2020 05:35:46 PM CET - permalink -
    - http://LOLmdrJuliette
    lycee
  • php
    <!DOCTYPE html>
    <html>
    <head>
    <title>Réponse au formulaire</title>
    <meta charset="utf-8">
    </head>
    <body>
    <h2>Votre formulaire à bien été envoyé</h2>
    <p>Bonjour <?php echo htmlspecialchars($_POST('prenom')); ?> ! </p>
    <p><script type="text/javascript">alert('formulaire envoyé')</script>
    </body>
    </html>
    Tue 14 Jan 2020 05:32:47 PM CET - permalink -
    - http://lolmdrnoé
    lycee
  • Dictionnaire
    mon_dico = {"Claude":"Nathan","Piere": "Alfonce", "date de naissance": "10/12/2003"}
    print(mon_dico)
    mon_dico['ville de naissance']= "Marseille"
    print(mon_dico)
    print("===================")
    print(f'À {mon_dico["ville de naissance"]}')
    mon_dico["age"]= "16"
    del mon_dico["date de naissance"]
    print(f' {mon_dico["age"]}')
    print(f'vous aurez bientot: {mon_dico["age"]}')
    Tue 17 Dec 2019 05:04:23 PM CET - permalink -
    - http://dico
    lycee python
  • Sac a dos aléatoire
    from time import *
    from random import*

    index_objet = [1,2,3,4,5,6,7,8,9,10] #Index de départ
    masse_objet = [5,4,7,6,1,3,2,8,9,10] #Masse de départ
    prix_objet = [100,2,45,36,78,94,12,65,78,2] #Prix de départ
    f_tab = [] #Tableau final contenant les solutions des prix
    tab_sol = [] #Tableau final contenant les solutions massique
    start = time() #Mesure le temp de calcul

     
    masse_sac_max = 10 #Masse maxiamale du sac au début
    masse_sol = 0 #Masse totale du sac


    while masse_sol < masse_sac_max : #Crée une boucle qui se repetera tant de la masse actuel sera inferieur à la masse maximale
      longeur = len(masse_objet)-1 #Crée un variable qui corespond à la taille du tableau massique
      indice_aleatoire = randint(0,longeur) #Crée une variable aléatoire corespondant a un indice du tableau  
      n = masse_objet[indice_aleatoire] #Crée une variable coorespondant à la valeur situé à l'indice aléatoire précedant
      print ("Valeur aléatoire : ",n)
      prix_sol = prix_objet[indice_aleatoire] #Crée une variable égale au prix dans le tableau prix à l'indice aléatoire précedant
      f_tab.append(prix_sol) #Ajoute la valeau du prix à un tableau
      index_objet.pop(indice_aleatoire) #Supprime la valeur et l'indice de l'indice aléatoire du tableau des index
      masse_objet.pop(indice_aleatoire) #Supprime la valeur et l'indice de l'indice aléatoire du tableau des masses
      prix_objet.pop(indice_aleatoire) #Supprime la valeur et l'indice de l'indice aléatoire du tableau des prix
      masse_sol2 = masse_sol + n #Masse totale du sac secondaire pour ne pas changer la première en cas de resultat faux
      if  masse_sol2 <= 10: #test si la futur masse sera bien <= à 10
          masse_sol = masse_sol + n #Si oui elle comfirme le calcule et ajoute la nouvelle masse
      else :
          break  #Sinon elle s'arrete
     
    end = time()

    print("La masse finale est",masse_sol,)
    print("Les prix sont :",f_tab,"soit un totale de :",sum(f_tab))
    print("Le temps est de : ", end-start)
    Tue 10 Dec 2019 05:44:56 PM CET - permalink -
    - http://python
    python
  • Tridusacparquotien
    from time import *

    index_objet = [1,2,3,4,5,6,7,8,9,10]
    mass_objet = [5,4,7,6,1,3,2,8,9,10]
    prix_objet = [100,2,45,36,78,94,12,65,78,2]
    f_tab = []
    start = time()

    masse_sac = 0 #Masse totale du sac
    quo_objet = 0 #Quotient d'un objet de la liste mass_objet ou prix_objet
    quo_sac = [] #Liste de tout les quotients quo_objet
    indice_quotient = 0 #Indice du quotient d'un objet de la liste quo_sac
    prix_sac = [] #Prix total du sac

     
    while masse_sac <= 10 :
      quo_sac = []
      for i in range (0,len(mass_objet)) : # On rempli la liste quo_sac
          quo_objet = prix_objet[i]//mass_objet[i]
          quo_sac.append(quo_objet)
     
      max_quo=max(quo_sac) #Objet + gros quotient
      indice_quotient = quo_sac.index(max_quo) #Index de cet objet dans la liste des quotients des objets
      if masse_sac+mass_objet[indice_quotient] <= 10 :
          masse_sac = masse_sac+mass_objet[indice_quotient] # Ajoute la masse de cet objet dans une liste qui doit être < 10
          f_tab.append(index_objet[indice_quotient]) #Ajout de l'index de l'objet dans la liste finale
         
          prix_sac.append(prix_objet[indice_quotient]) #Ajout du prix de l'objet ajouté dans le prix total
         
          mass_objet.remove(mass_objet[indice_quotient])
          prix_objet.remove(prix_objet[indice_quotient])
          index_objet.remove(index_objet[indice_quotient])
       
      else :
          break
     
    end = time()

    print("Les index des objets à prendre sont : ",f_tab,"Le poids total du sac est", masse_sac, "et le prix :", prix_sac)
    print("Le temps est de : ", end-start)
    Tue 03 Dec 2019 04:17:38 PM CET - permalink -
    - ?SVe8UA
    lycee python
  • Tri dichotonique
    from time import *

    def recherche_dichotomique( element, liste_triee ):
      indice_min = 0
      indice_milieu = 0
      indice_max = len(liste_triee)-1
      while indice_milieu <= indice_max :
          indice_milieu = (indice_min + indice_max)//2
          valeur_centrale = liste_triee[indice_milieu]
          if element == valeur_centrale :
              return indice_milieu
          elif element > valeur_centrale :
              indice_min = indice_milieu+1
          else :
              indice_max = indice_milieu - 1
          indice_milieu = (indice_min + indice_max)//2
      return -1

    def recherche_lineaire(c,liste_triee) :
      for i in range (0,len(tab)):
          if c==tab[i] :
              return("Valeur trouvée")
              break
      return("Valeur non trouvée")

    tf=int(input("Cherchez un nombre: "))  
    tab = [p for p in range (1000)]

    start = time()
    x=recherche_dichotomique(tf,tab)
    end = time()
    print("Avec la recherche linéaire : ",x,end-start)

    start2 = time()
    mo =recherche_dichotomique(tf,tab)
    end2 = time()
    print("Avec la recherche dichotomique : ",x,end2-start2)
    Tue 26 Nov 2019 05:05:11 PM CET - permalink -
    - http://bjkeaz
  • Algorythme de tri par selection
    def tri_selection(tab) :
      for i in range (0,len(tab)):
          mini = i
          for y in range (i+1,len(tab)):
              if tab[y] < tab[mini] :
                  mini = y
          if mini != i:
              temp=tab[i]
              tab[i]=tab[mini]
              tab[mini]=temp
      return


    from random import *

    mon_tab = []

    for element in range (0,10) :
      val=randint(0,100)
      mon_tab.append(val)


    tri_selection(mon_tab)
    print(mon_tab)
    Sat 16 Nov 2019 04:15:08 PM CET - permalink -
    - http://581
    lycee python
  • Algorythme de tri par bulle
    def tri_par_bulle(tab):
     n = len(tab)
     for i in range (n):
       for j in range (0, n-1):
        if tab[j] > tab[j+1] :
          tab[j], tab[j+1] = tab[j+1], tab[j]
     return

    from random import *
    mon_tab = []

    for i in range (0,10) :
       x = randint(0,100)
       mon_tab.append(x)

    tri_par_bulle(mon_tab)

    print(mon_tab)
    Fri 15 Nov 2019 10:56:49 PM CET - permalink -
    - http://cfdtrhy
    lycee python
  • Algorithme de tri par insertion
    def tri_insertion(tab):
      N = len(tab)
      for n in range(1,N):
          K = tab[n]
          j = n-1
          while j>=0 and tab[j] > K:
              tab[j+1] = tab[j]
              j = j-1
          tab[j+1] = K
      return

    from random import *
    mon_tab = []


    for i in range (0,10) :
      x=randint(0,100)
      mon_tab.append(x)
    tri_insertion(mon_tab)

    print(mon_tab)
    Fri 15 Nov 2019 10:08:31 PM CET - permalink -
    - http://5
    lycee python
  • BlackJack
    import os
    import random

    decks = input("Enter number of decks to use: ")

    # user chooses number of decks of cards to use
    deck = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]*(int(decks)*4)

    # initialize scores
    wins = 0
    losses = 0

    def deal(deck):
       hand = []
       for i in range(2):
           random.shuffle(deck)
           card = deck.pop()
           if card == 11:card = "J"
           if card == 12:card = "Q"
           if card == 13:card = "K"
           if card == 14:card = "A"
           hand.append(card)
       return hand

    def play_again():
       again = input("Do you want to play again? (Y/N) : ").lower()
       if again == "y":
           dealer_hand = []
           player_hand = []
           deck = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]*4
           game()
       else:
           print("Bye!")
           exit()

    def total(hand):
       total = 0
       for card in hand:
           if card == "J" or card == "Q" or card == "K":
               total+= 10
           elif card == "A":
               if total >= 11: total+= 1
               else: total+= 11
           else: total += card
       return total

    def hit(hand):
       card = deck.pop()
       if card == 11:card = "J"
       if card == 12:card = "Q"
       if card == 13:card = "K"
       if card == 14:card = "A"
       hand.append(card)
       return hand

    def clear():
       if os.name == 'nt':
           os.system('CLS')
       if os.name == 'posix':
           os.system('clear')

    def print_results(dealer_hand, player_hand):
       clear()

       print("\n    WELCOME TO BLACKJACK!\n")
       print("-"*30+"\n")
       print("    \033[1;32;40mWINS:  \033[1;37;40m%s   \033[1;31;40mLOSSES:  \033[1;37;40m%s\n" % (wins, losses))
       print("-"*30+"\n")
       print ("The dealer has a " + str(dealer_hand) + " for a total of " + str(total(dealer_hand)))
       print ("You have a " + str(player_hand) + " for a total of " + str(total(player_hand)))

    def blackjack(dealer_hand, player_hand):
       global wins
       global losses
       if total(player_hand) == 21:
           print_results(dealer_hand, player_hand)
           print ("Congratulations! You got a Blackjack!\n")
           wins += 1
           play_again()
       elif total(dealer_hand) == 21:
           print_results(dealer_hand, player_hand)
           print ("Sorry, you lose. The dealer got a blackjack.\n")
           losses += 1
           play_again()

    def score(dealer_hand, player_hand):
           # score function now updates to global win/loss variables
           global wins
           global losses
           if total(player_hand) == 21:
               print_results(dealer_hand, player_hand)
               print ("Congratulations! You got a Blackjack!\n")
               wins += 1
           elif total(dealer_hand) == 21:
               print_results(dealer_hand, player_hand)
               print ("Sorry, you lose. The dealer got a blackjack.\n")
               losses += 1
           elif total(player_hand) > 21:
               print_results(dealer_hand, player_hand)
               print ("Sorry. You busted. You lose.\n")
               losses += 1
           elif total(dealer_hand) > 21:
               print_results(dealer_hand, player_hand)
               print ("Dealer busts. You win!\n")
               wins += 1
           elif total(player_hand) < total(dealer_hand):
               print_results(dealer_hand, player_hand)
               print ("Sorry. Your score isn't higher than the dealer. You lose.\n")
               losses += 1
           elif total(player_hand) > total(dealer_hand):
               print_results(dealer_hand, player_hand)
               print ("Congratulations. Your score is higher than the dealer. You win\n")
               wins += 1

    def game():
       global wins
       global losses
       choice = 0
       clear()
       print("\n    WELCOME TO BLACKJACK!\n")
       print("-"*30+"\n")
       print("    \033[1;32;40mWINS:  \033[1;37;40m%s   \033[1;31;40mLOSSES:  \033[1;37;40m%s\n" % (wins, losses))
       print("-"*30+"\n")
       dealer_hand = deal(deck)
       player_hand = deal(deck)
       print ("The dealer is showing a " + str(dealer_hand[0]))
       print ("You have a " + str(player_hand) + " for a total of " + str(total(player_hand)))
       blackjack(dealer_hand, player_hand)
       quit=False
       while not quit:
           choice = input("Do you want to [H]it, [S]tand, or [Q]uit: ").lower()
           if choice == 'h':
               hit(player_hand)
               print(player_hand)
               print("Hand total: " + str(total(player_hand)))
               if total(player_hand)>21:
                   print('You busted')
                   losses += 1
                   play_again()
           elif choice=='s':
               while total(dealer_hand)<17:
                   hit(dealer_hand)
                   print(dealer_hand)
                   if total(dealer_hand)>21:
                       print('Dealer busts, you win!')
                       wins += 1
                       play_again()
               score(dealer_hand,player_hand)
               play_again()
           elif choice == "q":
               print("Bye!")
               quit=True
               exit()


    if __name__ == "__main__":
      game()
    Sat 09 Nov 2019 02:49:27 PM CET - permalink -
    - http://blacjkoazr
    commande lycee python
  • Les trois algorithmes de tri
    Tri par sélection :

    872149
    187249
    128749
    124879
    124789

    Tri par bulles :

    Étape 1.
    1.1. ( 5 1 4 2 8 ) {\displaystyle \to }\to  ( 1 5 4 2 8 ). Les nombres 5 et 1 sont comparés, et comme 5 > 1, l'algorithme les échange.
    1.2. ( 1 5 4 2 8 ) {\displaystyle \to }\to  ( 1 4 5 2 8 ). Échange, car 5 > 4.
    1.3. ( 1 4 5 2 8 ) {\displaystyle \to }\to  ( 1 4 2 5 8 ). Échange, car 5 > 2.
    1.4. ( 1 4 2 5 8 ) {\displaystyle \to }\to  ( 1 4 2 5 8 ). Pas d'échange, car 5 < 8.
    À la fin de cette étape, un nombre est à sa place définitive, le plus grand : 8.
    Étape 2.
    2.1. ( 1 4 2 5 8 ) {\displaystyle \to }\to  ( 1 4 2 5 8 ). Pas d'échange.
    2.2. ( 1 4 2 5 8 ) {\displaystyle \to }\to  ( 1 2 4 5 8 ). Échange.
    2.3. ( 1 2 4 5 8 ) {\displaystyle \to }\to  ( 1 2 4 5 8 ). Pas d'échange.
    5 et 8 ne sont pas comparés puisqu'on sait que le 8 est déjà à sa place définitive.
    Par hasard, tous les nombres sont déjà triés, mais cela n'est pas encore détecté par l'algorithme.
    Étape 3.
    3.1. ( 1 2 4 5 8 ) {\displaystyle \to }\to  ( 1 2 4 5 8 ). Pas d'échange.
    3.2. ( 1 2 4 5 8 ) {\displaystyle \to }\to  ( 1 2 4 5 8 ). Pas d'échange.
    Les deux derniers nombres sont exclus des comparaisons, puisqu'on sait qu'ils sont déjà à leur place définitive.
    Puisqu'il n'y a eu aucun échange durant cette étape 3, le tri optimisé se termine.
    Étape 4.
    4.1. ( 1 2 4 5 8 ) {\displaystyle \to }\to  ( 1 2 4 5 8 ). Pas d'échange.
    Le tri est terminé, car on sait que les 4 plus grands nombres, et donc aussi le 5e, sont à leur place définitive.

    Tri par insertion :

    Voici les étapes de l'exécution du tri par insertion sur le tableau [6, 5, 3, 1, 8, 7, 2, 4]. Le tableau est représenté au début et à la fin de chaque itération.

    .
    i = 1 :
    6 5 3 1 8 7 2 4
    ⟶
    5 6 3 1 8 7 2 4
    i = 2 :
    5 6 3 1 8 7 2 4
    ⟶
    3 5 6 1 8 7 2 4
    i = 3 :
    3 5 6 1 8 7 2 4
    ⟶
    1 3 5 6 8 7 2 4
    i = 4 :
    1 3 5 6 8 7 2 4
    ⟶
    1 3 5 6 8 7 2 4
    i = 5 :
    1 3 5 6 8 7 2 4
    ⟶
    1 3 5 6 7 8 2 4
    i = 6 :
    1 3 5 6 7 8 2 4
    ⟶
    1 2 3 5 6 7 8 4
    i = 7 :
    1 2 3 5 6 7 8 4
    ⟶
    1 2 3 4 5 6 7 8
    Fri 08 Nov 2019 09:28:44 AM CET - permalink -
    - http://Tri/Tri
    lycee python
  • eazjhousqhv
    #tableau de base pour afficher les carrés des nombres jusqu'à 11
    tab2=[element**2 for element in range(11)]
    print(tab2)

    #tableau valeur pair, montre les carrés des nombres pairs
    tab3=[element**2 for element in range(11) if element%2==0]#if p%2==0] (pour prendre les nombres pair et ==1 pour nombre impair)
    print(tab3)

    #longeur du tableau des carrés pairs
    longueur_tab3=len(tab3)

    #demander à l'utilisateur d'entrer une valeur de 0 à 100
    valeur=int(input("entrer un entier entre 0 et 100 :"))

    indice=-1
    for i in range (longueur_tab3):
    #for element in tab3:
      if(valeur==tab3[i]):
          indice=i
          break
     
    if(indice==-1):
      print("la valeur n'est pas dans le tableau")
    else:
      print("la valeur est dans la case ",indice+1)

    #j'ajoute des valeurs dans mon tableau
    tab3.append(16)
    tab3.insert(1,16)
    tab3.insert(-1,16)
    print(tab3)
         
    #tableau pour savoir si un nombre est dans le tableau
    tab=[]
    mon_tab=[p**2 for p in range (0,11)]
    x=int(input("entrer un nombre entre 0 et 100 inclus : "))
    if tab.count(x)>0:#count compte le nombre de fois ou x est présent dans le tableau si different de 0 alors présent
      print("le nombre est dans la case")
    else:
      print("non")

    valeur = int(input("Entrez la valeur à entrer : "))
    tab_occ = []
    for i in range (len(tab3)) :
     if (valeur == tab3[1]):
       tab_occ.append(i+1)
    print(tab3)
    print (f"Le nombre d'occurance de {valeur} est {len(tab_occ)} :", tab_occ)
     
    for i in range (len(tab3)) :
     maxi = max(tab3)
     mini = min(tab3)
    print (f"Le nombre minimun est {mini} et le nombre maximun est {maxi} :", tab3)
    #Sans utlilisé max et min ou peut faire :
    #mini = ta3[0]
    #for i in range (len(tab3)):
    # if mini>tab3[i]:
    #   mini=tab3[i]
    #print ("La valeur minimamle est : ", mini)
    Fri 08 Nov 2019 08:18:35 AM CET - permalink -
    - http://uygdo
    lycee python
  • six coups
    from random import *
    bar = []
    h=0

    for x in range (0,6) :
    x=randint(0,1)
    bar.append(x)
    if x==1 :
      break
    y=len(bar)
    for z in range (0,-y) :
    bar.append(0)


    for b in range (0,y) :
    life=(input("Appuyer 1 puis sur entrée pour tirer :"))
    if bar[h]==0 :
      print("Vous vous en sortez")
      k=int(input())
      h=h+1
    else :
      print("Vous n'avez même pas entendu le bruit de la balle que vous gisiez par terre")
      v=int(input())
      break

    from random import *
    bar = []
    h=0
    jade=0

    for x in range (0,6) :
     jade = randint(0,100)
     if jade>17 :
       jade=0
       bar.append(jade)
     else :
       jade=1
       bar.append(jade)
       y=len(bar)
       for z in range (0,6-y) :
         bar.append(0)
       break


    print(bar)
    Tue 05 Nov 2019 05:15:11 PM CET - permalink -
    - http://eref
    commande programme python
  • les tab en une ligne
    mon_tab = [n**2 for n in range(0,11)]
    print (mon_tab)

    mon_tab = [n**2 for n in range(0,11) if n%2==0]
    print (mon_tab)

    mon_tab = [n**2 for n in range(0,11) if n%2==0]
    x=int(input("Entrer le nombre de votre choix : "))
    if mon_tab.count(x)>0 :
      print ("Votre nombre est compris dans le tableau")
    else :
     print("Votre nombre n'est pas compris dans le tableau")

    #Noélegenie
    Tue 05 Nov 2019 04:32:02 PM CET - permalink -
    - http://eazes
    commande lycee python
  • Python lecture de tableau avec l et p
    l=[1,7,9,15,5,20,10,8]
    mon_tab = [p**2 for p in l if p < 10]
    print (mon_tab)

    Sur cette commande sera mis au carré si il appartient a l et qu'il est inférieur à 10


    m = [[1,3,4],
        [5,6,8],
        [2,1,3],
        [7,8,15]]
    a = m[1][2]
    print (a)

    Ceci est un tableau avec colone et ligne le nombre m[1][2] correspond à 8 ligne 1 colonne 2
    Fri 18 Oct 2019 09:20:27 AM CEST - permalink -
    - http://jbeir
  • Programe de NSI première
    Cours
    Cours
    Cours
    Cours
    Fri 18 Oct 2019 09:14:19 AM CEST - permalink -
    - https://pixees.fr/informatiquelycee/n_site/nsi_prem.html
  • Python Sum
    Fri 18 Oct 2019 09:04:39 AM CEST - permalink -
    - https://www.programiz.com/python-programming/methods/built-in/sum
    commande lycee python
Links per page: 20 50 100
◄Older
page 1 / 3
Shaarli 0.0.41 beta - The personal, minimalist, super-fast, no-database delicious clone. By sebsauvage.net. Theme by idleman.fr.