Como borrar valores con delete en el siguiente programa
Publicado por Marcos (3 intervenciones) el 16/02/2020 13:36:38
Tengo este programa, como eliminaría el valor anterior al introducir UT dentro de la secuencia?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
def codigo (i):
switcher={
"AA":"Glycine",
"TU":"Arginine",
"AT":"Cysteine",
"UA":"Serine",
"AU":"Start",
"UT":"Delete",
"TT":"End",
"UU":"Lysine"
}
return switcher.get(i,"Error")
mensaje=input("Introduce el código:")
longitud=len(mensaje)
penultima=longitud-2
inicio=mensaje[0:2]
final=mensaje[penultima:longitud]
if inicio=="AU" and final=="TT":
print ("Los aminoacidos son:")
for k in range (2,penultima):
if k%2==0:
i=mensaje[k:k+2]
else:
print(codigo(i)," ", end=" ")
Valora esta pregunta


0