Community member
OliviaPy
Member since May 2025 · last post 27 Oct, 16:32
- 16 threads
- 45 comments
- 5 solutions
- 231 upvotes received
Counts public posts in this language only.
Latest threads
-
2points4
-
4points4
-
10points4
-
7points4
** 0.5 vs math.sqrt
Solved -
0points4
-
11points5
Is "5" a number or a string?
Solved -
11points4
-
11points4
-
1points4
Stage 2 — why key=str.lower?
Solved -
9points4
Stage 2 — negative latitude
Solved
Latest comments
-
In Stage 2 — the quotes look normal to me
Learned this the hard way copying code from a PDF.
-
In Should I delete the debug line or comment it out?
Didn't know about Ctrl+/ — game changer.
-
In Where to start with a 70-line repetitive script?
Rename t, m, s to real names while you're at it — "Names that explain" pays off here.
-
In How do you remember all the syntax?
I keep a personal cheat sheet file with snippets I've needed more than twice. Writing it down helps me remember too.
-
In insert(1, ...) — "position 1" is second?
Right, the commander stays at 0.
-
For stage 2, launch.items() gives key-value pairs in insertion order, so the output order matches the JSON. Two spaces of indentation inside the f-string.
-
In RuntimeError: dictionary changed size during iteration
The comprehension version is really clean, going with that.
-
In splitlines() vs split("\n")
splitlines() handles all line endings (\n, \r\n from Windows files, etc.) and doesn't give you an empty string at the end if the text ends with a newline. Safer for real data.
-
In Stage 1 — DEFAULTS got changed too
The | merge operator is great. But stage 2 needs the loop anyway for the unknown-key check.
-
In IndexError: list assignment index out of range Solution
Assignment by index only changes existing positions; it can't create new ones. Use append() to add: crew = [] crew.append("Ada")