This content originally appeared on DEV Community and was authored by sheema
I just wrapped up Day 4 of my Python journey! Today was all about moving beyond simple scripts and learning how to handle data more dynamically. It was a challenging day, but seeing the logic come together in the end was worth it.🧠
What I Learned Today Randomization: Using the random module to create unpredictable outcomes.Lists: How to store data in order, use offsets, and append new items.Index Errors: Learning the hard way that lists start at 0!Nested Lists: Creating lists within lists (basically making a grid or a map).🛠️
The Projects
- Banker Roulette A simple script that takes a list of names and randomly picks who has to pay for the meal. No more arguing over the bill!
- Treasure Map : This was a cool exercise in nested lists. I built a 3x3 grid where you can input coordinates (like 23) to "hide" your treasure with an 'X'. It really helped me visualize how 2D arrays work.
- Rock Paper Scissors The "boss fight" of the day. I built a game where you play against the computer. Managing the logic for who wins based on the list index was tricky but fun.🧗
The Struggle is Real I'll be honest: today was tough. There were moments where the logic for nested lists didn't click immediately. I used Chat GPT to help debug my errors and explain some of the more complex movements. It’s a great reminder that as a developer, you don't have to know everything instantly—you just have to know how to find the answer!
python #codingjourney #100daysofcode #learningtocode #programming
This content originally appeared on DEV Community and was authored by sheema
sheema | Sciencx (2026-05-11T17:45:37+00:00) Day 4: Leveling Up with Lists and Randomness in Python 🐍. Retrieved from https://www.scien.cx/2026/05/11/day-4-leveling-up-with-lists-and-randomness-in-python-%f0%9f%90%8d/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.