0% found this document useful (0 votes)
46 views6 pages

Stack Implementation Programs in Python

yes fr

Uploaded by

dhairyaihs
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views6 pages

Stack Implementation Programs in Python

yes fr

Uploaded by

dhairyaihs
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

STACK

JOURNAL

By Dhairya
Shah

Program – 1
Aim: menu driven program to implement a stack
named as ‘train’, where each element of the
stack contains (train_no, train_name). Using
push(), pop(), display() and peek().
Modules used: None
Datatypes used: int,list
Program :

57
Output

58
Program – 2
Aim: Push the keys (ProdName) of the dictionary
into a stack,. Pop and display the contents of the
stack
Modules used: None
Datatypes used: int,list
Program

Output

59
Program – 3
Aim: Push the keys (ID of the students) of the
dictionary into a stack, where corresponding
name begins from letter ‘A’. Pop and display the
contents of the stack.
Modules used: None
Datatypes used: dict,list
Program :

Output

60
Program – 4
Aim: Traverse the content of the list and push the
even numbers into a stack. Pop and display the
content of the stack.
Modules used: None
Datatypes used: int, list
Program :

Output

61

You might also like