Introduction
Over the past few weeks, I’ve been diving into the first 7 chapters of Crash Course Python, and it’s been a fun, sometimes head-scratching, but always rewarding ride. To make the concepts stick, I built small projects using lists, dictionaries, conditionals, loops, and string manipulation. Here’s a breakdown of what I created and learned — and how I plan to build on this foundation.
Hello Toolbox: Strings and User Input
Here’s a snippet from my “Hello Toolbox” script, where I play around with user input and string formatting:
name = input("Welcome to my toolbox, what is your name? \n")
print(
f"Hello, {name.title()} a pleasure to meet you\nHere is your name in different styles:\n\t Lower Case: {name.lower()}\n\t Upper Case: {name.upper()}\n\t Title: {name.title()}"
)
I even let users remove and replace a fun fact using .pop()
and .append()
:
index = int(input("Select 1 or 2 to remove a fact\n"))
popped_fact = facts.pop(index - 1)
new_fact = input("Add a replacement fact\n")
facts.append(new_fact)
What I Learned:
input()
+f-strings
make interactions fun..pop()
and.append()
gave me hands-on list manipulation.
Playing with Lists: Random Numbers and Grades
In this project, I generated random numbers and experimented with filtering and grading them.
numbers = [random.randint(1, 100) for _ in range(10)]
even_numbers = [x for x in numbers if x % 2 == 0]
grades = ["A" if n >= 90 else "B" if n >= 80 else "C" if n >= 70 else "D" if n >= 60 else "F" for n in numbers]
I added options for the user to:
- Split numbers into even/odd
- Convert them to letter grades
- View a detailed summary using
zip()
Takeaway: List comprehensions feel very Pythonic once you get the hang of them!
Quiz Time: Dictionaries + Logic
This was my trivia quiz project — a list of dictionaries with questions and answers. I handled multiple-choice vs open-ended questions differently:
if q["type"] == "mcq":
for option in q["options"]:
print(option)
user_answer = input("Your answer (A–D): ").strip().upper()
else:
user_answer = input("Your answer: ").strip().lower()
What I Practiced:
- Iterating over dictionaries
- Nesting conditionals inside loops
- Validating user answers and scoring
Pig Latin Fun: Playing with Strings
Here’s my first attempt at a Pig Latin translator:
vowels = ["a", "e", "i", "o", "u"]
while True:
word = input("Enter a word (or 'q' to quit): ").lower()
if word == "q":
break
if word[0] in vowels:
print(f"{word}yay")
else:
print(f"{word[1:]}{word[0]}ay")
Lessons Here:
- String slicing is clean and powerful.
- Rebuilding strings with
''.join()
was an eye-opener. - Infinite
while True
loops +break
helped me create natural exit conditions.
Reflections & What’s Next
After 8 chapters, I’m comfortable with:
- Using
input()
andprint()
for interaction - Formatting strings with f-strings
- Managing lists and dictionaries
- Writing conditionals and loops
I’m ready to tackle:
- Functions and modular code
- Error handling and debugging
- More text-based games and mini utilities
Thanks for reading, and let’s see what the tide brings tomorrow!
Join Me on My Journey
If you’d like to follow along, I’ll be sharing more about my learning process, projects, and insights here and on my GitHub repository. Feel free to connect — I’d love to hear about your coding journey too!