-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSeqSearch.py
More file actions
36 lines (27 loc) · 789 Bytes
/
SeqSearch.py
File metadata and controls
36 lines (27 loc) · 789 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
31
32
33
34
35
class SequentialStringList:
def add(self, sce):
test = sce.split()
if test == '':
print("nothing stored")
else:
UserL = test
#print(UserL)
return UserL
def find (self, sce, gogo):
found = False
count = 0
#gofind = self.findstr.split()
hey = sce.split()
while count < len(hey) and not found:
if hey[count] == gogo:
found = True
print("it found", gogo )
else:
count = count + 1
return found
newstring = "hey how are you ?"
findstr = "you"
Seq = SequentialStringList()
#print(newstring)
Seq.add(newstring)
print(Seq.find(newstring, findstr))