ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Stacks in Python | Stack Creation, Operations & Applications | 1st Year Computer | Chapter 4 | L2

Автор: Digital Education

Загружено: 2025-10-29

Просмотров: 382

Описание: Social Media Links:
_____/❤ All Students are requested to Follow Me on Social Media!! ❤\_______
 Instagram:➜   / digitaleduc.  .
 Twitter:➜   / shahbaz_ali101  
 Facebook Page:➜   / 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)
[email protected]

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Stacks in Python | Stack Creation, Operations & Applications | 1st Year Computer | Chapter 4 | L2

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Lists in Python | List Creation, Operations & Applications | 1st Year Computer | Chapter  4 | Lec 01

Lists in Python | List Creation, Operations & Applications | 1st Year Computer | Chapter 4 | Lec 01

Queues in Python | Queue Creation, Operations & Applications | 1st Year Computer | Chapter 4 | Lec 3

Queues in Python | Queue Creation, Operations & Applications | 1st Year Computer | Chapter 4 | Lec 3

Greedy Algorithms Explained with Example | Class 11 Computer Science | 11th Computer | Ch 3 | Lec 8

Greedy Algorithms Explained with Example | Class 11 Computer Science | 11th Computer | Ch 3 | Lec 8

Types of Application Software Explained | 10th Lecture – Tech Taleem

Types of Application Software Explained | 10th Lecture – Tech Taleem

⏰ Создание графического интерфейса для цифрового будильника с использованием Python Tkinter | Пош...

⏰ Создание графического интерфейса для цифрового будильника с использованием Python Tkinter | Пош...

Unit 7 Entrepreneurship | 7.1 You will be your own boss, 7.1.1 |Class 9th Computer | FBISE | NBF

Unit 7 Entrepreneurship | 7.1 You will be your own boss, 7.1.1 |Class 9th Computer | FBISE | NBF

Binary Search Algorithm Explained | Searching in Sorted List | 11th Computer Science | Ch 3 | Lec 14

Binary Search Algorithm Explained | Searching in Sorted List | 11th Computer Science | Ch 3 | Lec 14

Stacks | Computational Data Structure | 11th Computer - Ch 4 - Lec 2

Stacks | Computational Data Structure | 11th Computer - Ch 4 - Lec 2

Zakaz foto odpadów w Bełchatowie, a PGE Zielona Góra chce dane przechodnia, bo filmuje! #294

Zakaz foto odpadów w Bełchatowie, a PGE Zielona Góra chce dane przechodnia, bo filmuje! #294

Tusku musisz! Ujawnienie wszystkim ofiarom Pegazusa tej informacji wykończy PiS, Kaczyńskiego

Tusku musisz! Ujawnienie wszystkim ofiarom Pegazusa tej informacji wykończy PiS, Kaczyńskiego

Queue Data Structure | Queues | 11th Computer - Chapter 4 - Lec 3

Queue Data Structure | Queues | 11th Computer - Chapter 4 - Lec 3

Цифровой ошейник» для всей семьи: Как школьный мессенджер MAX собирает на вас досье?

Цифровой ошейник» для всей семьи: Как школьный мессенджер MAX собирает на вас досье?

Graphs | Graph Data Structures | 11th Computer - Ch 4 - Lec 5

Graphs | Graph Data Structures | 11th Computer - Ch 4 - Lec 5

Algorithm Analysis | Time & Space Complexity & Big O Notation | Class 11 Computer Science | C 3 | L6

Algorithm Analysis | Time & Space Complexity & Big O Notation | Class 11 Computer Science | C 3 | L6

Trees in Python | Tree Creation, Operations & Applications | 1st Year Computer | Chapter 4 | Lec 4

Trees in Python | Tree Creation, Operations & Applications | 1st Year Computer | Chapter 4 | Lec 4

NA ŻYWO: Powstaje koalicja przeciw Iranowi

NA ŻYWO: Powstaje koalicja przeciw Iranowi

Python series for Beginner 🚀|| Lecture 2 || Strings

Python series for Beginner 🚀|| Lecture 2 || Strings

Selection Sort Algorithm Explained | Sorting Techniques | 11th Computer Science | Chapter 3 | Lec 12

Selection Sort Algorithm Explained | Sorting Techniques | 11th Computer Science | Chapter 3 | Lec 12

#06 input function and Type Casting | Python Tutorial Bangla for Beginners | CodeWithSagor

#06 input function and Type Casting | Python Tutorial Bangla for Beginners | CodeWithSagor

Introduction to Graphs | Types, Properties & Characteristics | 1st Year Computer | Chapter 4 | Lec 5

Introduction to Graphs | Types, Properties & Characteristics | 1st Year Computer | Chapter 4 | Lec 5

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]