Problème en python
Mahdich05
-
Utilisateur anonyme -
Utilisateur anonyme -
bonjour j'ai fais un petit programme qui permet de traduire une séquence d'ARN en protéine mais je n'arrive pas à comprendre ce qui cloche car ça m'affiche qu'il y a erreur
genetic_code = {"UUU":"F","UUC":"F","UUA":"L","UUG":"L","UCU":"S","UCC":"S",
"UCA":"S","UCG":"S","UAU":"Y","UAC":"Y","UAA":"*","UAG":"*",
"UGU":"C","UGC":"C","UGA":"*","UGG":"W","CUU":"L","CUC":"L",
"CUA":"L","CUG":"L","CCU":"P","CCC":"P","CCA":"P","CCG":"P",
"CAU":"H","CAC":"H","CAA":"Q","CAG":"Q","CGU":"R","CGC":"R",
"CGA":"R","CGG":"R","AUU":"I","AUC":"I","AUA":"I","AUG":"M",
"ACU":"T","ACC":"T","ACA":"T","ACG":"T","AAU":"N","AAC":"N",
"AAA":"K","AAG":"K","AGU":"S","AGC":"S","AGA":"R","AGG":"R",
"GUU":"V","GUC":"V","GUA":"V","GUG":"V","GCU":"A","GCC":"A",
"GCA":"A","GCG":"A","GAU":"D","GAC":"D","GAA":"E","GAG":"E",
"GGU":"G","GGC":"G","GGA":"G","GGG":"G"}
def traduction(Arn , genetic_code):
proteine = ""
for i in range(0, len(Arn), 3):
codon = Arn[i : i + 3]
acide_amine = genetic_code[codon]
proteine = proteine + acide_amine
return proteine
traduction ("AUGGCCAUGGCGCCCAGAACUGAGAUCAAUAGUACCCGUAUUAACGGGUGA",genetic_code)
| EDIT : Ajout des balises de code (la coloration syntaxique).
Explications disponibles ici : ICI Merci d'y penser dans tes prochains messages. |
A voir également:
- Problème en python
- Citizen code python avis - Accueil - Outils
- \R python ✓ - Forum Python
- Ce programme est écrit en python il construit un mot secret ✓ - Forum Python
- Citizen code python solution - Forum Python
- Python par la pratique : 101 exercices corrigés pdf - Forum Python
1 réponse
Salut,
Moi non plus, je ne comprend pas car avec ton exemple ça me renvoie : 'MAMAPRTEINSTRING*'.
Voici le code que j'ai tapé :
Moi non plus, je ne comprend pas car avec ton exemple ça me renvoie : 'MAMAPRTEINSTRING*'.
Voici le code que j'ai tapé :
genetic_code = {"UUU":"F","UUC":"F","UUA":"L","UUG":"L","UCU":"S","UCC":"S",
"UCA":"S","UCG":"S","UAU":"Y","UAC":"Y","UAA":"*","UAG":"*",
"UGU":"C","UGC":"C","UGA":"*","UGG":"W","CUU":"L","CUC":"L",
"CUA":"L","CUG":"L","CCU":"P","CCC":"P","CCA":"P","CCG":"P",
"CAU":"H","CAC":"H","CAA":"Q","CAG":"Q","CGU":"R","CGC":"R",
"CGA":"R","CGG":"R","AUU":"I","AUC":"I","AUA":"I","AUG":"M",
"ACU":"T","ACC":"T","ACA":"T","ACG":"T","AAU":"N","AAC":"N",
"AAA":"K","AAG":"K","AGU":"S","AGC":"S","AGA":"R","AGG":"R",
"GUU":"V","GUC":"V","GUA":"V","GUG":"V","GCU":"A","GCC":"A",
"GCA":"A","GCG":"A","GAU":"D","GAC":"D","GAA":"E","GAG":"E",
"GGU":"G","GGC":"G","GGA":"G","GGG":"G"}
def traduction(Arn , genetic_code):
proteine = ""
for i in range(0, len(Arn), 3):
codon = Arn[i : i + 3]
acide_amine = genetic_code[codon]
proteine = proteine + acide_amine
return proteine
traduction (
"AUGGCCAUGGCGCCCAGAACUGAGAUCAAUAGUACCCGUAUUAACGGGUGA",
genetic_code)
dite moi s'ils vous plait
où l'avez vous exécuter ?