-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstackNaina.py
More file actions
50 lines (37 loc) · 846 Bytes
/
Copy pathstackNaina.py
File metadata and controls
50 lines (37 loc) · 846 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class stack:
def __init__(self):
self.stacky=[]
#self.top=-1
def push(self,value):
print(value)
return self.stacky.append(value)
def pop(self):
data=self.stacky.pop()
return data
def isEmpty(self):
for i in range(len(self.stacky)):
if self.stacky[i]==[]:
return True
def revString(mystring):
staky1=stack()
for i in mystring:
#print(i)
print(staky1.push(i))
#return data
#s=stack()
mystring1="NainaVinay"
#l=s.isEmpty()
#list1=[]
#print(l)
#for i in mystring1:
#print(i)
#print("Push mode",s.push(i))
#list1.append(chr)
#print (list1)
revString(mystring1)
#s.push(12)
#s.push(13)
#d1=s.pop()
#print(d1)
#d2=s.pop()
#print(d2)