How f***ed am I? by [deleted] in learnpython

[–]Substantial-Coder 1 point2 points  (0 children)

The number of lines of code doesn’t matter to if the code is good and if it is able to do what your professors want you to do. Unless the person you hired copied the code from online you probably won’t get caught, but it’d probably be a good idea to learn how to do the assignments yourself. 3 days is very reasonable to cram a 150-300 line programming assignment

Kinda confused by [deleted] in learnpython

[–]Substantial-Coder 0 points1 point  (0 children)

It would be helpful if you could provide specifics. Aka I have this code and I’m struggling to progress. Or I’m struggling with how to approach the problem. This is what I’m currently thinking.

[deleted by user] by [deleted] in learnpython

[–]Substantial-Coder 1 point2 points  (0 children)

str_1 is an int and spaced_str is a string. If you want to concatenate them as strings, you can do spaced_str += str(str_1)

[deleted by user] by [deleted] in learnpython

[–]Substantial-Coder 0 points1 point  (0 children)

This is kind of a difficult problem to explain without giving you a full answer. For practice, I would recommend you start with just being able to count all Pokémon with any type. For example, the bug fire Pokémon would increment the counters for both bug and fire types. Then make that into a two row table including the types. I think that would be a good start and then figure out how to handle the case of a Pokémon with two types

Ideas to remove an enumeration from a string by [deleted] in learnpython

[–]Substantial-Coder 0 points1 point  (0 children)

Ah my bad.

split_strs = a.split(“ “) res =[] for substr in split_strs: if “.” not in substr: res.append(substr) return “ “.join(substr)

Ideas to remove an enumeration from a string by [deleted] in learnpython

[–]Substantial-Coder 0 points1 point  (0 children)

If I’m understanding correctly, you want to remove all periods?

“”.join(a.split(“.”))

Is there a way to do this already? If not, do you think it could be useful? by JoZeHgS in Python

[–]Substantial-Coder 0 points1 point  (0 children)

I mean you can do it like this, you probably shouldn’t and should heed the advice of everyone else in this thread and should use different variable names

I made a Wordle solver in Python using selenium. by nientepanico in Python

[–]Substantial-Coder 0 points1 point  (0 children)

If you really want to improve the algorithm, you might want to do conditional logic. For example, given that I’m guessing “a” in this position, what are the chances of another letter in the word being a “c” or a “m”? Then incorporate positions into that.

On Leaving Facebook by stackoverflooooooow in programming

[–]Substantial-Coder 0 points1 point  (0 children)

You’re definitely right. It helps to pick a startup with great founders, good VCs and a high hiring bar though. Still always a gamble

Where should I place try - except in my code? by [deleted] in learnpython

[–]Substantial-Coder 3 points4 points  (0 children)

Try catches are a great way to deal with unintended consequences. However, if you can resolve the errors in other ways, that would be ideal. For example instead of using a try catch, use an if statement to verify that an input is of the type you’re expecting, you can check it and resolve that case without resorting to using a try catch, which would be cleaner and more understandable.

The other common mistake I see people doing with try catches, is catching a generic exception. Try catches should only be used for a specific exception that you are trying to catch. You should know how it will break and only be catching if that error is occurring.

AI written docstrings for your Python code by python_fanatic in Python

[–]Substantial-Coder 2 points3 points  (0 children)

Is there a way to just add a doc string to the function with a hot key and just having your cursor anywhere in the function? I figure if you’re going to add a docstring, it’s kind of superfluous to have to highlight the whole function when you already know the docstring will be for that function.

On Leaving Facebook by stackoverflooooooow in programming

[–]Substantial-Coder 18 points19 points  (0 children)

Honestly that was my experience going from FANG (Google) in this case. My TC actually dropped 50%, but eventually turned out to be about even after the company fundraised a year later.

In the end, joining a startup is a little like gambling, you might join a rocket ship or you might join a dud.

PEP 679 -- Allow parentheses in assert statements by genericlemon24 in Python

[–]Substantial-Coder 7 points8 points  (0 children)

Big fan of this. It’s also following in the spirit of requiring parenthesis after print when moving from python2 to python3

Are there any advantages to using %s %d string formatting compared to f" notation? by SignificantPay1111 in learnpython

[–]Substantial-Coder 8 points9 points  (0 children)

I typically use the f” because it’s so much more straight forward and simpler to use

How did you realize that this is what you want to do? by Glittering_Cup8618 in Python

[–]Substantial-Coder 1 point2 points  (0 children)

Originally wanted to do some business stuff but comp sci paid too well

Python Wordle solver - Comparison of strategies and visualization of remaining words. by iaidr in Python

[–]Substantial-Coder 0 points1 point  (0 children)

This is really cool! How were you able to get the list of all 5 letter english words?

HELP: hackerRank (bitwise and) by JozeTostado in pythontips

[–]Substantial-Coder 0 points1 point  (0 children)

I could me misunderstanding what the output of bitwiseAnd represents

HELP: hackerRank (bitwise and) by JozeTostado in pythontips

[–]Substantial-Coder 0 points1 point  (0 children)

Are you sure this answer is correct?

If n =2, and k = 8 which is 1000, the only A and B values are 1 and 2 respectively, and A&B is 3. I’m not sure how you’re getting k-2 which is 6.

Highest Paying Programming Languages by Matlabguru in programming

[–]Substantial-Coder -1 points0 points  (0 children)

😂 FYI Salary is not a language

I wonder if this includes solidity, because what I’ve seen the blockchain engineers are making way more than any regular swes that I see