Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
>>> h = create_hash_table(5)
>>> h
[[], [], [], [], []]
>>> type(h)
>>> hash(3375228)
3375228
>>> hash("AAT")
2040823534
>>> hash("AAT")%5
4
>>> insert(h, "AAT")
>>> h
[[], [], [], [], ['AAT']]
>>> insert(h, "AAA")
>>> h
[[], [], ['AAA'], [], ['AAT']]
>>> hash("AAA")%5
2
>>> insert(h, "TTT")
>>> insert(h, "TTC")
>>> insert(h, "TTG")
>>> h
[['TTT'], [], ['AAA', 'TTC'], [], ['AAT', 'TTG']]
>>> find(h, "TTC")
2
>>> find(h, "TTC7")
>>> s = {1,2,3}
>>> s
{1, 2, 3}
>>> d = {1:2, 4:55, "a":8}
>>> d
{1: 2, 4: 55, 'a': 8}
>>>
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
>>> longest_common_substring(Mycobacterium_leprae, Mycobacterium_tuberculosis)
1 found
2 found
3 found
4 found
5 found
6 found
7 found
8 found
9 found
10 found
11 found
12 found
13 found
14 found
15 found
16 found
17 found
18 found
19 found
20 found
21 found
22 found
23 found
24 found
25 found
26 found
27 found
28 found
29 found
30 found
31 found
32 found
33 found
34 found
35 found
36 found
37 found
38 found
39 found
40 found
41 found
42 found
43 found
44 found
45 found
46 found
47 found
48 found
49 found
50 found
51 found
52 found
53 found
54 found
55 found
56 found
57 found
58 found
59 found
60 found
61 found
62 found
63 found
64 found
65 found
66 found
67 found
68 found
69 found
70 found
71 found
72 found
73 found
74 found
75 found
76 found
77 found
78 found
79 found
80 found
81 found
82 found
83 found
84 found
85 found
86 found
87 found
88 found
89 found
90 found
91 found
92 found
93 found
94 found
95 found
96 found
97 found
98 found
99 found
100Traceback (most recent call last):
File "", line 1, in
longest_common_substring(Mycobacterium_leprae, Mycobacterium_tuberculosis)
File "C:\Users\Amir\Desktop\hash\longest_common_ss.py", line 9, in longest_common_substring
print(k, "found")
File "C:\Python34\lib\idlelib\PyShell.py", line 1352, in write
return self.shell.write(s, self.tags)
KeyboardInterrupt
>>> longest_common_substring_bsearch(Mycobacterium_leprae, Mycobacterium_tuberculosis)
Starting binary search on length of common substring...
1 found
2 found
4 found
8 found
16 found
32 found
64 found
128 found
256 not found
Now searching for lengths between 129 and 255 ...
192 found
224 found
240 not found
232 not found
228 not found
226 found
227 found
The longest common substring is of length 227 : AACAGGATTAGATACCCTGGTAGTCCACGCCGTAAACGGTGGGTACTAGGTGTGGGTTTCCTTCCTTGGGATCCGTGCCGTAGCTAACGCATTAAGTACCCCGCCTGGGGAGTACGGCCGCAAGGCTAAAACTCAAAGGAATTGACGGGGGCCCGCACAAGCGGCGGAGCATGTGGATTAATTCGATGCAACGCGAAGAACCTTACCTGGGTTTGACATGCACAGGA
>>>
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
>>> find_motifs("[AB]T[^U]", "srgATYsdATYfATY")
ATY from 3 to 6
ATY from 8 to 11
ATY from 12 to 15
3 matches found
>>> find_motifs("[AB]T[^U]", "srgATYsdATEfATF")
ATY from 3 to 6
ATE from 8 to 11
ATF from 12 to 15
3 matches found
>>>