Tag: coding
-
Flash Card Project: Exploring Data Types and Variables in Python
I recently completed a project called the Flash Card Project, which was an exciting learning experience that deepened my understanding of Python’s versatility with data types and variables. This project involved using various Python features like dictionaries, lists, and Pandas to manage data and display flash cards for language learning. Here’s a breakdown of the…
-
Effortlessly Extract and Print Dictionary Items with Units in Python
Extracting and printing specific items from a dictionary in Python could be a nightmare. You may want to print only the values or keys. Maybe you want to print both in one report or what could you do if you are adding additional information such as units? Let’s say you have a dictionary with a…
-
Mastering Control Flow: Using While Loops and Conditionals to Meet Specific Conditions
Within the logic of the Blackjack game, there is a condition that must be met. After the user picks his cards, it is time for the computer to play. The computer has to ask for a card when the sum of its deck is less than 16. The original logic was: Input: Output: computer’s final…
-
Efficient List Manipulation in Python: When to Use ‘append’ and ‘extend’
Let’s say I created a function in Python to deal a group of cards. The Ace is represented by 11, Jack, Queen, and King by 10 and the rest of the deck shows its face value. This function will randomly take an element from the list named cards and return a list with a number.…