12. Card Game WAR:Four different ways to delete items from a list in Python: pop, del, clear, remove

Опубликовано: 27 Октябрь 2025
на канале: WIBYTE
43
1

In this video look at four different ways to delete items from a list in Python. We see how these are all useful in different contexts and we see several examples to understand the similarities and differences between them.

Other videos in the playlist -
1. Introduction and Learning Objectives -    • 1. Card Game WAR : Introduction and Learni...  
2. Game Rules -    • 2. Card Game WAR in Python: Game Rules  
3. Creating a Deck of Cards -    • 3. Card Game WAR: Using a nested loop to c...  
4. Shuffling the Deck of Cards -    • 4. Card Game WAR : Using random.shuffle() ...  
5. Doing the toss! -    • 5. Card Game WAR : Creating a toss using r...  
6. Dealing the cards to the two players using list slicing -    • 6. Card Game WAR : Using list slicing to d...  
7. Understanding the game scheme: A nested while loop -    • 7. Card Game WAR : Understanding the code ...  
8. Getting both players to play a card using the pop method -    • 8. Card Game WAR : How to use the pop() me...  
9. Checking for a winner in a move -    • 9. Card Game WAR : Use list indexing to de...  
10. The difference between append and extend methods for lists in Python -    • 10. Card Game WAR : What is the difference...  
11. Setting up the WAR -    • 11. Card Game WAR : Setting up the WAR whe...  
12. Four different methods to delete items from a list in Python -    • 12. Card Game WAR:Four different ways to d...  
13. Develop the outer loop -    • 13. Card Game WAR : How to Develop the out...  
14. Print statements to display the list status and interpreting the results -    • 14. Card Game WAR : How and where to print...  
15. Determine the final winner -    • 15. Card Game WAR : Determining the final ...  

Ideas for Enhancement
Enhance the Toss
1. Both players pick up 1 card -    • 1. Card Game War Enhancements : Enhancing ...  
2. Winner by a combination of suit and value -    • 2. Card Game War Enhancements: Enhancing t...  
3. Both players pick up multiple cards -    • 3. Card Game War Enhancements: Enhancing t...  

Joker
4. Add Joker card to the gameplay -    • 4. Card Game War Enhancements: Joker Card ...  

Innovative ways to deal cards
5. Using List Slicing and Loops -    • 5. Card Game War Enhancements: Innovative ...  
6. Incorporating Randomness -    • 6. Card Game War Enhancements: Incorporate...  

WAR Game Variants
7. Progressive WAR -    • 7. Card Game War Enhancements: War Variant...  
8. Speed WAR -    • 9. Card Game War: War Variant- Speed War  
9. WAR played with suits -    • 8. Card Game War Enhancements: War Variant...  

Active Role for player and computer
10. Player chooses from the first three cards -    • 10. Card Game War Enhancements: Player get...  
11. Computer chooses from the first three cards -    • 11. Card Game War Enhancements: Computer p...  

Checkout more interesting projects for learning Python on our course website here - https://wibyte.in