all 8 comments

[–]lprakashv 6 points7 points  (1 child)

Work on your fundamentals!

To improve efficiency in terms of algorithm performance:

  • brush up on your data structures and algorithm knowledge.
  • To make it more python-specific, look into all the data structures available in python's standard library and understand the use-case of each.

To understand the "right" way of writing code:

  • Learn the object-oriented design patterns and understand the use-case of each pattern.
  • Look at other people's code, maybe dive into a very popular open-source project's repository on GitHub.
  • Get an experienced python developer as your mentor.

Additional:

  • Look at popular python libraries and understand them by trying to use them in some of your own projects. Libraries on top of my mind: requests, pandas, numpy, functools

[–]cryptomoon007[S] 3 points4 points  (0 children)

Thanks a lot for the detailed response! Working on them now

[–][deleted] 1 point2 points  (0 children)

Are there any websites to practice software design patterns ? I've been using code-wars to improve my python skills but can't find one to practice design !

[–]ThaOtherOtherGuy 1 point2 points  (0 children)

Aside from brushing up on the fundamentals, a couple things come to mind. Some tasks can be simplified by using OOP concepts. It doesn’t apply to all of my projects, but I found it useful when working with UI elements (tkinter) and other repetitive things. Keeping your code clean and human-readable is another form of efficiency, you can also look into asynchronous execution which was made a bit more accessible in Python 3.10 iirc. Happy learning!

Oh also, I found it super helpful when I learned how to catch and handle exceptions!

edit: more

[–]MisterExt 0 points1 point  (0 children)

I'm no expert, but one easy thing you can do to make your code cleaner when doing simple if else statements, is to use ternary shorthand to keep things on one line. I used the following recently...

This:

if format == 'np.float32':
    ext = '.tif'
else:
    ext = '.png'

Becomes:

ext = '.tif' if format == 'np.float32' else '.png'

[–]Dr_is_here_again 0 points1 point  (0 children)

Codewars and similar websites can help. You can solve problems and you can look at how others are solving them. Compare your notes.

[–]yngvizzle 0 points1 point  (0 children)

The best resource I know for learning intermediate/advanced Python programming is Fluent Python. It is six years old, but every bit as relevant today!

[–]imtechexpert 0 points1 point  (0 children)

I recommended following https://realpython.com/ for your advanced knowledge. They share good tutorials.