Menu

Post image 1
Post image 2
Post image 3
Post image 4
Post image 5
Post image 6
1 / 6
0

Day 4: Leveling Up with Lists and Randomness in Python 🐍

DEV CommunityΒ·sheemaΒ·21 days ago
#ACNYeJ2d
#python#beginners#codenewbie#devjournal#lists#today
Reading 0:00
15s threshold

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.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More