- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Stacks in Python | Stack Creation, Operations & Applications | 1st Year Computer | Chapter 4 | L2
Social Media Links:
______/❤ All Students are requested to Follow Me on Social Media!! ❤\________
Instagram:➜ https://www.instagram.com/digitaleduc...
Twitter:➜ https://twitter.com/shahbaz_ali101
Facebook Page:➜ https://www.facebook.com/digitalEduca...
Whatsapp:➜ https://chat.whatsapp.com/GqLGyGuZyNp...
Youtube:➜ https://bit.ly/32hA7C4?sub_confirmati...
4.1.2 Stacks
A stack is a simple data structure where you can only add or remove items from one end, known as the “top”. Both insertion and deletion of elements occur at this top end. A stack operates on the Last-In, First-Out (LIFO) principle, meaning that the most recently added element is the first one to be removed.
4.1.2.1 Stack Operations
There are two basic operations in a stack:
• Push Operation: Push means adding an item to the top of the stack.
• Pop Operation: Pop means removing the item from the top of the stack.
# Create an empty stack of booksstack_of_books = []
print("Initial stack:", stack_of_books) # Empty stack
# Add books to the stack (push operation)
print("\n Adding books to the stack (push operation):")
stack_of_books.append(’Book A’)
print("Stack after pushing ’Book A’:", stack_of_books)
stack_of_books.append(’Book B’)
print("Stack after pushing ’Book B’:", stack_of_books)
# Remove the top book from the stack (pop operation)
print("\nDeletion of top book (pop operation):")
top_book = stack_of_books.pop()
print("Removed book:", top_book)
print("Stack after popping the top book:", stack_of_books)
The code creates an empty stack to hold books. It then adds books (“Book A” and “Book B”) one by one to the top of the stack. Finally, it removes the top book “Book B” from the stack, showing how the last book added is the first one taken off.
#DigitalEducation
#DigitalEducationLatestNews
#DigitalEducationShahbazAli
#11thComputerScience2025
#ComputerScience2025
#FScComputerScience
#1stYearComputerScience
#ComputerScienceLectures
#CSPakistan
#CSForBeginners
#FScPart1
#CSTutorials
#DigitalEducation
#Python #Stacks #PythonProgramming #ComputerScience #Class11 #DigitalEducation #PythonTutorial #DataStructures #CodingForBeginners #PythonBasics
Computer Science 11th class
Lecturer of Computer Science
By Sir Shahbaz Ali
For any query or private tutoring contact (0309-0334424)
shahbazalicp@gmail.com
Видео Stacks in Python | Stack Creation, Operations & Applications | 1st Year Computer | Chapter 4 | L2 канала Digital Education
______/❤ All Students are requested to Follow Me on Social Media!! ❤\________
Instagram:➜ https://www.instagram.com/digitaleduc...
Twitter:➜ https://twitter.com/shahbaz_ali101
Facebook Page:➜ https://www.facebook.com/digitalEduca...
Whatsapp:➜ https://chat.whatsapp.com/GqLGyGuZyNp...
Youtube:➜ https://bit.ly/32hA7C4?sub_confirmati...
4.1.2 Stacks
A stack is a simple data structure where you can only add or remove items from one end, known as the “top”. Both insertion and deletion of elements occur at this top end. A stack operates on the Last-In, First-Out (LIFO) principle, meaning that the most recently added element is the first one to be removed.
4.1.2.1 Stack Operations
There are two basic operations in a stack:
• Push Operation: Push means adding an item to the top of the stack.
• Pop Operation: Pop means removing the item from the top of the stack.
# Create an empty stack of booksstack_of_books = []
print("Initial stack:", stack_of_books) # Empty stack
# Add books to the stack (push operation)
print("\n Adding books to the stack (push operation):")
stack_of_books.append(’Book A’)
print("Stack after pushing ’Book A’:", stack_of_books)
stack_of_books.append(’Book B’)
print("Stack after pushing ’Book B’:", stack_of_books)
# Remove the top book from the stack (pop operation)
print("\nDeletion of top book (pop operation):")
top_book = stack_of_books.pop()
print("Removed book:", top_book)
print("Stack after popping the top book:", stack_of_books)
The code creates an empty stack to hold books. It then adds books (“Book A” and “Book B”) one by one to the top of the stack. Finally, it removes the top book “Book B” from the stack, showing how the last book added is the first one taken off.
#DigitalEducation
#DigitalEducationLatestNews
#DigitalEducationShahbazAli
#11thComputerScience2025
#ComputerScience2025
#FScComputerScience
#1stYearComputerScience
#ComputerScienceLectures
#CSPakistan
#CSForBeginners
#FScPart1
#CSTutorials
#DigitalEducation
#Python #Stacks #PythonProgramming #ComputerScience #Class11 #DigitalEducation #PythonTutorial #DataStructures #CodingForBeginners #PythonBasics
Computer Science 11th class
Lecturer of Computer Science
By Sir Shahbaz Ali
For any query or private tutoring contact (0309-0334424)
shahbazalicp@gmail.com
Видео Stacks in Python | Stack Creation, Operations & Applications | 1st Year Computer | Chapter 4 | L2 канала Digital Education
python Stacks Stack operations Stack creation in python python data structures computer science class 11 digital education python tutorial Stack insertion deletion python programming basics python Stack examples Stack indexing python Stack properties Stack applications class 11 computer practical python coding for beginners learn python pakistan 11th computer science 11th class computer science 2025 computer science 1st year 1st year computer science
Комментарии отсутствуют
Информация о видео
29 октября 2025 г. 21:16:57
00:13:16
Другие видео канала





















