Community member
SamPrice
Member since September 2025 · last post 25 Oct, 18:59
- 10 threads
- 57 comments
- 11 solutions
- 249 upvotes received
Counts public posts in this language only.
Latest threads
Latest comments
-
In Stage 2 — why reverse the loops?
Great 2D exercise. Grids appear in so many problems.
-
In Book or videos — what worked for you?
Python Crash Course here. The projects at the end are a nice bridge to real code.
-
[0] * 3 is fine because numbers are immutable. The problem is only with mutable things like lists or dicts.
-
In Stage 2 — why separate ifs instead of elif?
Exactly why. elif stops after the first match. For a checklist you want every failing rule reported, so each rule needs its own independent if.
-
In What should be the next challenge theme?
Rover on Mars: path planning, battery, terrain grids. Lots of loops and 2D lists.
-
In Why does print need brackets? Old tutorial doesn't use them
Your book is written for Python 2. In Python 3 print became a normal function, so it needs brackets like every other function call: print("Hello"). Python 2 has been unsupported since 2020, so I'd honestly put that book…
-
In round(2.5) is 2?? Is this a bug?
Accountants love this one 😄
-
{mass:,} was new to me. Very handy for big numbers.
-
In LEGB rule — what does it stand for? Solution
It's the order Python searches for a name: - Local — inside the current function - Enclosing — inside outer functions (for nested functions) - Global — the module level - Built-in — names like len, print First match win…
-
In Stage 2 — split("-") breaks LIFE-SUPPORT-4 Solution
Use rsplit with a max split of 1. It splits from the right, only once, so everything before the last dash stays together.