- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex.py
More file actions
Latest commit
30 lines (25 loc) Β· 593 Bytes
/
Copy pathex.py
File metadata and controls
30 lines (25 loc) Β· 593 Bytes
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
26
27
28
29
30
defcheck_chaine(chaine) :
tab=list(chaine)
i=0
whilei<len(chaine):
iftab[i] !='a'andtab[i] !='t'andtab[i] !='g'andtab[i] !='c' :
error=1
print ('error')
break
else :
i+=1
error=0
adn=input("Enter chain : ")
check_chaine(adn)
iferror==1:
exit
minichain=input("Enter sequence : ")
rs=0
save=0
whilers<len(adn) orrs==0:
print ("ok");
print (rs)
save=rs
rs=adn.find(minichain, rs)
ifrs<=save :
exit