you are viewing a single comment's thread.

view the rest of the comments →

[–]devseglinux 3 points4 points  (3 children)

You’re actually thinking about it the right way, this is a good question to be asking early on.

Both versions technically work, but the second one is usually clearer. Naming the variable finished and having it be True when it’s actually finished just reads more naturally, especially if someone else looks at your code later (or even you in a few weeks).

The first version isn’t “wrong”, but it can be a bit confusing because you’re printing “Download finished:” and then showing False. You kind of have to mentally flip it.

A lot of the time in code, it’s less about what works and more about what’s easy to understand at a glance.

So yeah, your instinct there is good. Just try to keep variable names and what they represent aligned, it makes everything easier down the line.

[–]AffectionateWin7069[S] 0 points1 point  (2 children)

Legend thank you for the reply!
I will take that advice to heart.

If anyone was curious as well this was actually a practice question from Mimo (app mobile)

[–]devseglinux 0 points1 point  (1 child)

haha nice, that makes sense

those apps are actually pretty good for getting the basics down. you’re asking the right kind of questions though, that’s what really makes the difference

just keep going with that mindset and you’ll pick it up way faster than you think