stack1 = []
stack2 = []
for number in range(1,61):
stack1.append(number)
print(f"Value Pushed in Stack 1 is {number}")
for number in range(1,41):
stack2.append(number)
print(f"Value Pushed in Stack 2 is {number}")
print("Print Pushed Values:")
counter=len(stack1)-1
while(counter>=0):
print(f"{stack1[counter]}",end=" ")
counter-=1
for number in range(61,103):
if len(stack1)<=100:
stack1.append(number)
print(f"Pushing Value in Stack 1 is {number}")
else:
print("Stack Full! Cannot Push")
while(len(stack1)>0):
print(f"{stack1.pop()} is being popped from Stack 1")
if len(stack1)==0:
print("Stack Empty! Cannot Pop")
Comments
Leave a comment