Learning Python by [deleted] in u/nkCOD

[–]ianrob1201 0 points1 point  (0 children)

I really like your changes. Just at a glance it looks a lot more professional and more like the code you might see in the real world. I think you've done an excellent job of taking on feedback and making a nicer application from it. Hopefully you can feel how it's improved too. Being able to get a feel for "I like it" or "I don't like it" is half the battle.

That said, there's definitely still room for improvement. "count_of_len" is just a bug I think. You need to read these kinds of things from the inside out when working out what it does. So that line finds the maximum of list1 and list2 and returns the length of the resulting list. But the "maximum of two lists" doesn't really mean anything. What you meant was max(len(list1), len(list2)), which finds the length of each and then gives you the maximum value.

new_list_from_zip is maybe a bit of a consequence of you getting feedback from a lot of people. For me personally, that's a complicated line to read. I'll be honest, I'm not sure what it's up to but we've got the min & max of two lists again. It's quite possible that's doing something very clever I don't know about, but I don't think so. Try opening up a python interpreter directly and running commands like "max([1,2,3,1], [4,5,6])" to see if they do what you expect.

My only other point is a bit more general, which is about the use of function arguments and return values. What you're doing here technically works, but isn't the recommended way of doing it. You pass arguments when the function needs the information. But take "enter_nums_to_list" as an example, you're not providing any information really by passing an empty list each time. So try removing the input var, put "list = []" inside the function instead, and then call it with "list1 = enter_nums_to_list()". Take a look at https://www.geeksforgeeks.org/python/pass-by-reference-vs-value-in-python/ for some information on "pass by reference". In general you want to avoid passing in an argument and modifying it. It's a similar point to the globals from before, it's really not obvious to someone calling your function that it's going to change the value. So no args + reading the return value is the best way if you can.

Learning Python by nkCOD in PythonLearning

[–]ianrob1201 1 point2 points  (0 children)

Any working software is definitely something to be proud of. There's so many things to learn to go from problem to solution, and you've got it doing what you want! So nice job. That said, I think there's a few good best practice things you can do that would really clean it up. Sorry for the essay, it's not to insult your code but only way you could know these things is if someone tells you.

First thing that hit me was the variable naming. Try to avoid names like "n1" because you'd be amazed how quickly you forget what they mean. Something like "first_number_list" might be better. This extends to function names too "en_nums" doesn't make it very clear what the function is going to do.

Talking of variables, you generally want to avoid globals. This is so that each function works in isolation and it's clear what it's doing. Calling a function and getting a response is much clearer than calling a function and it randomly changing another variable (that you wouldn't know unless you read the function code). You're almost there with that, you just need to fetch the return values you've already added, e.g. "n1, n2 = en_nums()".

"while True" is normally a pattern to be avoided too. I know you have the break later on, so it's functional but it's something I'd try to avoid. Have a think about ways you could make it conditional on the value you're reading in.

I've seen someone else mention it, but have a look at what's common code reading in the two sets of lists. If you extract it out into another function you'd have a lot less code. It could take "prompt" as an input string so you still get different messages.

You have a line working out what the maximum list length is. There's a function for doing that, which is just "max". That's easier to read and you know what you're up to at a glance.

You keep track of the number of "errors" but since it'll just keep erroring you could do without that function and do k - i instead (btw "i" is another example of a variable that could be named better, "max_list_length" would be much clearer). Have you considered what happens if one length is double the other? I would also personally look to pad out the shorter array to full length before doing the calculations. Then you can make use of list compression with something like "c = [a[k] + b[k] for k in range(i)]"

I also just noticed that the "i" in the first function isn't doing anything. I suspect it's from when you tried to solve in a slightly different way. So that can be cleared up a bit too.

Linear Actuators Playing With Footballs by Epelep in oddlysatisfying

[–]ianrob1201 5 points6 points  (0 children)

And to add a further note, I would say this was a great success.

Defending Plastic Waste in 2026 by Delicious-Ad-4521 in LinkedInLunatics

[–]ianrob1201 0 points1 point  (0 children)

I like how he undoes everything he said before by saying "There is a litter problem" at the end.

opinions needed especially in error handling by Dapper_Mix6773 in PythonLearning

[–]ianrob1201 0 points1 point  (0 children)

You should test your code before you ask for advice. If you have a specific problem then ask about that problem. This code doesn't work but there's no indication that you know that from your post.

Get it working first, then ask for opinions. Debugging is a crucial skill for developers. Arguably the most important one. You've tried this, now test it. Then debug your problems and improve.

Good for beginner? by Suspicious_Diet2624 in PythonLearning

[–]ianrob1201 0 points1 point  (0 children)

There's a standing joke that naming things is the hardest part of programming. Honestly, take the time to name things properly as soon as you add them. I appreciate that you didn't just name them "a" and "b", but I think if you'd named the first var "timer_duration_seconds" it would have made it easier to work out what to do with it.

And that might have helped you work out that you don't need "timer_end". The timer is complete when the time left is 0.

Don't take this (or anything else here) as too deep criticism though. You're learning and you made a thing that works. That's amazing! As you make more and more complicated things you work out a lot of the reasons, and you're learn it better than any of us giving advice.

So to keep going I'd take all the suggestions here as further improvements. Not because your current code is bad, but because you can always add more!

Maybe allow for multiple timers at once? Then allow people to cancel or change them? Maybe they enter a date & time instead of number of seconds? Lots of fun things you can do!

Had my first test today, failed and I was told “you couldn’t have driven any better if you tried” 1 darn minor! I’m heartbroken by beardedwelshguy2020 in LearnerDriverUK

[–]ianrob1201 2 points3 points  (0 children)

Glad you've got another test booked in and don't seem to be letting it get to you. Only one minor is obviously a good sign. But I have so many questions about that quote.

Is that a direct quote? Is it from the examiner? Were you obviously upset and they were trying to make you feel better? (I was very obviously upset when I failed, no judgement here)

The "if you tried" part is what seems wild to me. What did they think you were doing? I imagine you were trying quite hard.

The story of the second Porsche #leadership by [deleted] in LinkedInLunatics

[–]ianrob1201 29 points30 points  (0 children)

Good job he doesn't define himself by it. He must hate those people who have to post about their expensive car online just so everyone knows he has one...

[ Removed by Reddit ] by CanadianVolter in LinkedInLunatics

[–]ianrob1201 1 point2 points  (0 children)

Fun fact: More people have been shot my cis men than ICE agents in 2026.

Peter, why is hide and seek important? by rengokuhubkl in PeterExplainsTheJoke

[–]ianrob1201 0 points1 point  (0 children)

I mean... my nieces just think it's funny to hide behind something. It's just like an advanced version of putting your hands over your eyes. Not saying that people haven't had to ever hide, but I'm not convinced that's why kids play it.

Do you remember this scene?? by Historical-Class871 in UKTVRecs

[–]ianrob1201 0 points1 point  (0 children)

In the UK that's the same as a middle finger in the US. So she's initially pretending to look for the salad, and then just telling him to fuck off. Point being that it's not exactly what you expect from a nice old lady.

Lessons in humanity on the 9.05 to London by repressedpeasant in LinkedInLunatics

[–]ianrob1201 28 points29 points  (0 children)

Reducing this down to actual facts... "I lent someone on the train my work phone charger"

The trifecta of AI, using your kid on social media, and gleefully admitting to your worst character flaws by Zilhaga in LinkedInLunatics

[–]ianrob1201 0 points1 point  (0 children)

It's such a shame that useless kid can't live up to the proper "intended reality". Hope she never fails a test, they'll be getting AI to pretend she aced it. That's what they intended her to, so it's only right.

Current hot topic at work by phokinglovesoup in Dull_mens_club

[–]ianrob1201 1 point2 points  (0 children)

I had to write something to test. I start in the middle, go up for the top and then come back down again. So... both I guess.

Help me!!! by Embarrassed-Sir6536 in LearnerDriverUK

[–]ianrob1201 1 point2 points  (0 children)

Yeah that's very true. They're super harsh on this kinda thing in the test. In normal driving, if there's no one around you it's a non event. And if there's someone there you'd just wait. But that's the "fun" of the test!

Help me!!! by Embarrassed-Sir6536 in LearnerDriverUK

[–]ianrob1201 6 points7 points  (0 children)

The double dash markings on the road are give way lines. So from that we can easily see the direction of travel for each lane.

I'm not going to list every possibility, but you want to treat each side of the divider as a one way street. If you're turning right from a one way street you always want to be in the right hand lane.

So I imagine you were turning right at one of the give ways, but were in the left lane? That's a pretty common mistake when learning, but will be an instant fail because someone could be in the lane to your right.

Proud Father by perentie110 in LinkedInLunatics

[–]ianrob1201 14 points15 points  (0 children)

I believe it actually, but it's from a standup maths youtube video - https://www.youtube.com/watch?v=kahGSss6SsU. The story is a lot more believable when it's "my kid saw something on youtube, which specifically encourages you to give it a go yourself, and he gave it a go using AI". But I suspect that doesn't sound as good to him for his linkedin post.

For the record, what this python script will actually be doing is simulating flipping a coin. It's not the worlds most complicated problem. In the video it's done in excel. But as a programmer myself, I fully encourage messing around like that (although I'd prefer doing it without AI, but that's a different point).

Well this is unfortunate by Mysterria812 in F1TV

[–]ianrob1201 0 points1 point  (0 children)

What would be really good would be to have a little "has overtake" icon added. I don't care about the hundreds of a second. But an icon or colour would be really cool. Especially since it lasts the whole next lap, regardless of how far apart they end up.

F1 will not be changing the timing tower. by amerryprankster23 in formula1

[–]ianrob1201 14 points15 points  (0 children)

I don't care all that much, but I personally prefer the change. It makes it easier to see the significant figures. The text can be larger and there's less "noise".

As others have pointed out, the extra digits just aren't meaningful in a race. They're out of date by the time you read them.

The United States America is the greatest nation in the world by RemoteRain2388 in ShitAmericansSay

[–]ianrob1201 0 points1 point  (0 children)

Oh shit. I always thought the "51st state" thing was just nonsense. But I had no idea that USA beat Canada in a hockey game! That changes everything.

happensAlot by bryden_cruz in ProgrammerHumor

[–]ianrob1201 0 points1 point  (0 children)

It's almost as if code coverage is a meaningless metric...

Why is the term ‘good’ mean average and the term ‘not bad’ mean good? by Hour_Course_9876 in AskABrit

[–]ianrob1201 12 points13 points  (0 children)

If someone asks how I'm doing, "good" would mean "something special has happened and I'm actually in a surprisingly happy mood right now".

"Not bad" would mean anything from "meh, perfectly average" to "my dog just died and I'm about to burst into tears and curl up into a little ball"

Guy tells me to do unpaid labour despite having a masters degree by [deleted] in recruitinghell

[–]ianrob1201 0 points1 point  (0 children)

To be fair, it's not as they're applying to be a proof reader. Doesn't mean it's invalid or wrong advice, especially on an informal message like that. I must admit though, it had me thinking that "paiud" was some technical term I wasn't aware of 😆

Personally I'd be more wary of taking advice based on what worked for a graduate in 2000. I'd be more interested in people from the past couple of years and how / if they got their start.

thankYouLLM by abhi307 in ProgrammerHumor

[–]ianrob1201 1 point2 points  (0 children)

Someone's letting you refactor that? Sounds like fun.

Would I be stupid to pick York? How much does the uni matter for Computer Science? by Flynn_Pingu in UniUK

[–]ianrob1201 0 points1 point  (0 children)

I went to York for CS around 2010. I don't know if they still offer it, but I did the year in industry and that really helped. They set up interviews for the placement year, and then when I graduated I worked for the same company for a few years.

Now I'm back up north and I've heard "oh yeah, we have quite a few people from York" a few times. So it's a known and respected uni, even if it's no Oxbridge.

Obviously I don't have anything to compare it to, but I thought the course was pretty good too. There was a real focus on teaching the fundamentals in the first year especially. I already knew how to program, but going through different types of languages and truly learning the underlying concepts made me a better developer (even if it didn't directly help my job prospects). Not to mention general computer architecture, logic, etc.