• Aucun résultat trouvé

1 : for j in range(0,len(alphabet)-1

N/A
N/A
Protected

Academic year: 2022

Partager "1 : for j in range(0,len(alphabet)-1"

Copied!
8
0
0

Texte intégral

(1)

1 VARIABLES

2 alphabet EST_DU_TYPE CHAINE 3 i EST_DU_TYPE NOMBRE

4 j EST_DU_TYPE NOMBRE 5 k EST_DU_TYPE NOMBRE 6 L1 EST_DU_TYPE CHAINE 7 L2 EST_DU_TYPE CHAINE 8 L3 EST_DU_TYPE CHAINE 9 codon EST_DU_TYPE CHAINE

10 nombre_codons EST_DU_TYPE NOMBRE 11 DEBUT_ALGORITHME

12 alphabet PREND_LA_VALEUR "ATCG"

13 codons PREND_LA_VALEUR 0 14 POUR i ALLANT_DE 0 A 3 15 DEBUT_POUR

16 L1 PREND_LA_VALEUR alphabet.substr(i,1) 17 POUR j ALLANT_DE 0 A 3

18 DEBUT_POUR

19 L2 PREND_LA_VALEUR alphabet.substr(j,1) 20 POUR k ALLANT_DE 0 A 3

21 DEBUT_POUR

22 L3 PREND_LA_VALEUR alphabet.substr(k,1) 23 codon PREND_LA_VALEUR L1+L2+L3

24 AFFICHER codon

25 nombre_codons PREND_LA_VALEUR nombre_codons+1 26 FIN_POUR

27 FIN_POUR 28 FIN_POUR 29

30 AFFICHER "Ce qui fait en tout "

31 AFFICHER nombre_codons 32 AFFICHER " codons"

33 FIN_ALGORITHME

(2)

alphabet=('ATCG') codons = 0

for index1, lettre1 in enumerate(alphabet) : for index2, lettre2 in enumerate(alphabet) : for index3, lettre3 in enumerate(alphabet) : print (lettre1+lettre2+lettre3)

codons = codons +1 print ("Il y a ", codons, " codons")

(3)

alphabet=('ATCG') def kodons (i) : if i == 1 :

for j in range(0,len(alphabet)-1) : yield alphabet[i]

else :

for k in kodons (i - 1) : yield k + alphabet[0]

yield k + alphabet[1]

yield k + alphabet[2]

yield k + alphabet[3]

for n in kodons(3) : print (n)

print (len(alphabet))

(4)

import itertools alphabet=('ATCG') condons = 0

for i,j,k in itertools.product(range(4),range(4),range(4)) : print (alphabet[i]+alphabet[j]+alphabet[k])

condons = condons +1

print ("Il y a ", condons, " condons")

(5)

alphabet=('ATCG') codons = 0

nb = 0

for index1, lettre1 in enumerate(alphabet) : for index2, lettre2 in enumerate(alphabet) : for index3, lettre3 in enumerate(alphabet) : print (lettre1+lettre2+lettre3)

codons = codons +1

print ('Il y a ' + str(codons) + " codons") def kodons (i) :

if i == 1 :

for j in range(0,len(alphabet)) : yield alphabet[j]

else :

for k in kodons (i - 1) :

for j in range(0,len(alphabet)) : yield k + alphabet[j]

for n in kodons(3) : nb = nb + 1 print (n)

print ('Il y a ' + str(nb) + " codons")

(6)

import itertools alphabet ='ATCG' taille_codon = 3

for i in itertools.product(alphabet,repeat=taille_codon) : print (i[0]+i[1]+i[2])

(7)

def f(L= 'ATCG',n=3):

return [s+l for l in L for s in f(L,n-1)] if n>1 else L print(f())

(8)

import itertools

for i in itertools.product("ATCG",repeat=3) : print (i[0]+i[1]+i[2])

Références

Documents relatifs

D´ eterminer un intervalle de fluctuation au seuil de 95 % de la fr´ equence de candidats re¸ cus dans un ´ echantillon al´ eatoire de 400 candidats.. Peut-on ´ emettre des doutes

This non-negative functional tF was shown to be lower semi-continuous on the set of Lipschitz functions with the 1: I topology and hence could be extended to

Si nous nous reportons aux r~sultats contenus dans notre travail relatif aux formes quadrilin6aires, nous verrons ais~ment que la condition A -~ o, entraine

Noussommespersuadés quel'utilisation de normescommunes faciliteledéveloppement de logicielcalculateuret ie rendeplustransparent.Ellesaccélèrent égalementles

outre les garde-corps, il met en scène le contraste entre le relief de la peau en béton blanc et les panneaux de béton recouverts d’une peinture métallisée qui, tantôt

[r]

[r]

I;i: Rate Constan- ts for Proton Transfer Reactions of Aqueous Alkylaninoni~m .Ions ·... ampl e,