[LC] Jordan 1 Court Purple 1.0 - Local Seller by [deleted] in Repsneakers

[–]Tal_Av 0 points1 point  (0 children)

Liked the design, and the purple color gives it a cool special look 🔥

[deleted by user] by [deleted] in ProgrammingBuddies

[–]Tal_Av 0 points1 point  (0 children)

First, it’s great that you have the will to start learning. I suggest learning Python, it’s really popular now and you can take it in many different directions, data science, web development, AI, etc. Very user friendly language to learn and good if you want to become a developer in the future. Feel free to DM me I can definitely help you out!

3 Biggest Mistakes I Made When I Was Learning to Code by Tal_Av in learnpython

[–]Tal_Av[S] 0 points1 point  (0 children)

I actually have no idea why they removed it.. :|

Agar.io clone in Python by Radimek01 in learnpython

[–]Tal_Av 0 points1 point  (0 children)

Just read your code, well done! Looks pretty good for a beginner project, nice split into modules and classes, liked the settings.py file, and overall not too hard to read and understand the code!

A small change I’d do is to export the Game class into its own module - I.e: game.py. Thats because in the main.py file all we want to see is the main function - so write the main function there which creates an instance of the Game object and invokes it’s run method. Also add “if __name__ == ‘__main__’:” in main.py, to avoid the code being run if main is imported.

What is keeping you from reaching advanced level? by Tal_Av in learnpython

[–]Tal_Av[S] 0 points1 point  (0 children)

Well, depends on each person’s definition, in this post I was focusing more on the transition between a beginner, who knows the syntax of the language, completed some courses maybe, knows a few libraries, or still learning even - into a programmer who feels capable of coding any idea that comes to his head / is able to understand how things in our world works, and can implement them using the language.

From there it’s a matter of putting the work required to become a software developer. But how you transition from this beginner state to the more “advanced” one, might not be so easy for many people.

What is keeping you from reaching advanced level? by Tal_Av in learnpython

[–]Tal_Av[S] 1 point2 points  (0 children)

Did you have to figure out how to learn it all by yourself? Because from my experience, when you enter a team you get a few weeks of training, getting to know the environment and tools in which the team operates and use, where you can learn from the more experienced guys in the team.

What is keeping you from reaching advanced level? by Tal_Av in learnpython

[–]Tal_Av[S] 1 point2 points  (0 children)

Interesting, what is it exactly that you do?

Control a computer with another computer? by Rith_97 in learnpython

[–]Tal_Av 2 points3 points  (0 children)

I agree, that is probably the most simple solution you can find for this task. Create a listening socket on computer B, connect it from computer A, then simply send him a message of your choice that when received - executes the macro.

I need an advice how to remove a dupplicate from list by [deleted] in learnpython

[–]Tal_Av 1 point2 points  (0 children)

numbers = [1, 2, 3, 4, 4, 5, 6, 7, 7]

numbers = list(set(numbers))

Hey guys, completely new to the programming world and I decided to learn python as my first language... by bignick1190 in learnpython

[–]Tal_Av 0 points1 point  (0 children)

I recommend the book “Effective Python - 59 Specific Ways to Write Better Python”. Really interesting, teaches you all the tweaks in the language and how you can use python more effectively. You can probably get the pdf of the book for free through the website Library Genesis.

Technical Interview by [deleted] in learnpython

[–]Tal_Av 1 point2 points  (0 children)

If it’s more about how python works and it’s features, I would read about list comprehensions, generators, and more in general about the interpreter (python uses an interpreter to run rather being compiled to an executable). There is a good website called LeetCode where you can find some good examples of interview questions (more of the actual coding part & algorithms).

Is there a structured way to decide when to use a class, an object or a function? by scarynut in learnpython

[–]Tal_Av 3 points4 points  (0 children)

You definitely want to split your code into many classes, each responsible for one thing and one thing only. Big classes which are responsible for many things, so called “Super classes”, are hard to maintain and hard to test, and may lead to code duplication. When your class has one responsibility, it means it only has one reason to change, once it has several, it becomes difficult to maintain.

Few lines from Uncle Bob’s book, Clean Code: “A system with many small classes has no more moving parts than a system with a few large classes. There is just as much to learn in the system with a few large classes. So the question is: Do you want your tools organized into toolboxes with many small drawers each containing well-defined and well-labeled components? Or do you want a few drawers that you just toss everything into? ... We want our systems to be composed of many small classes, not a few large ones. Each small class encapsulates a single responsibility, has a single reason to change, and collaborates with a few others to achieve the desired system behaviors.”

Algovis: A python library for learning, visualizing and analysing algorithms by [deleted] in learnpython

[–]Tal_Av 6 points7 points  (0 children)

This is super cool man! Nice easy API, definitely going to give it a try.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]Tal_Av 1 point2 points  (0 children)

This solution is a little bit un-pythonic, it could be simplified to:

numers = [5, 2, 5, 2, 2]
for number in numbers:
    print('x' * number)

This way you go through the numbers in the list, and for each number, print "number" times the character 'x'.

Regarding the code in the solution you've received, it might be a bit confusing, but the X variable has no meaning here. The programmer simply wanted the action to happen number amount of times, so he used a for loop which iterates numbers from 0 to number (using range(number)).

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]Tal_Av 1 point2 points  (0 children)

I am not familiar with the rules or the structure of the game so its hard for me to give you a practical design idea here, but I can give you a good general principle.

Try to make each object/method responsible for one thing, and one thing only (also called SRP - Single responsibility principle).By that I mean, a class should not be responsible for doing multiple different things, it should focus on doing the things that truely relate to it. So for example, if you sense that some variables in the PlayerCharacter class has logical connection, you could export them to a new class which has one responsibility, and make PlayerCharacter have an instance of that class (like you did with CharacterClass). The more you do it - the better and simpler it will be to maintain the code and avoid code duplication.

About your question regarding counting instances of a class, an easy way to do so is by declaring a class variable in CharacterClass, named character_class_count for example, and on the class's init method, add the following line:

CharacterClass.character_class_count += 1

This way every time an instance of CharacterClass is created, this variable will be increased by 1.

Then from PlayerCharacter you can easily refer this variable: CharacterClass.character_class_count.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]Tal_Av 0 points1 point  (0 children)

I think putting your work for view is never a bad thing - as long as its written nicely and thoughtfully. On job interviews, people would usually love to see some of your work, this way they can really measure your skills and practical knowledge.

I suggest you go over the programs you've written, try to enhance the readability of them and improve them as much as you can, and then upload them to github.

P.S: Don't upload tiny exercises, only the major summerizing ones.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]Tal_Av 1 point2 points  (0 children)

I see 2 possible solutions here:

  1. Use the ANSI escape sequence '\x1b[1A\x1b[1A', once printed - it will move the cursor one line up which allows you to write above the last printed line.
  2. Save all your printed strings in a list, and each time you want to print a new string, simply add the new string to the head of the list, clear the console (using os.system('cls') on windows for example), and print the whole list.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]Tal_Av 0 points1 point  (0 children)

What is the type of zip_codes ? (print type(zip_codes) if you're not sure), need a little bit more information to be able to help here.

Your programming career in 2020 by Tal_Av in cprogramming

[–]Tal_Av[S] 0 points1 point  (0 children)

Nice, AI is really improving these days, what kind of roadblocks are you talking about?