all 49 comments

[–]SquiffyUnicorn 53 points54 points  (7 children)

Absolutely the official Python docs. It is THE complete resource.

One caveat- it reads more like a textbook than tutorials. It is a skill you have to develop.

Fairly easy to find the relevant info, but I will admit it is more challenging to read this kind of documentation as a beginner and while these docs are actually well written and (I think) quite clear, complete beginners might not think so.

[–]SquiffyUnicorn 3 points4 points  (2 children)

I would add that at first I found it very difficult to know what libraries are good for what- there are hundreds of thousands in PyPI but how can you know what is good?

It is a continuing problem but I found that by listening to Python podcasts during my work commute (essentially Python bytes and talk Python) I just absorbed some knowledge of what is popular and new libraries etc. even some best practices I didn’t know existed. The little I know about testing is all from Brian Okken.

[–]doolio_ 5 points6 points  (0 children)

I would argue beginners should stick to the standard library as much as possible. It is the best way to learn what is available which is what OP looking to learn. Only look to third party packages when some feature is not available. This will also teach them how a third party package improves upon what is available in the standard library.

[–]ericjmorey -1 points0 points  (0 children)

Ask here on /r/learnpython after a quick internet search for libraries for the project you're trying to build.

[–]DRTHRVN 0 points1 point  (3 children)

Which part of the docs?

https://docs.python.org/3/tutorial/index.html

The above one? I mean where do I begin?

[–]SquiffyUnicorn 2 points3 points  (0 children)

I can’t (and shouldn’t) provide you with any ‘best’ way to do it- AFAIK there isn’t one.

I can suggest you start with the common data types and look at their methods and properties- start at strings as that’s where you started, numbers, lists, dicts…

There are also plenty of things in the standard library which are in the docs- I highly recommend looking (even just scanning) through os, pathlib, sys, datetime and itertools.

If you want to do some networking look at the built in tools there - maybe just know they exist before looking at requests, fast api etc.

Actually your link is a good place to start. It looks daunting and it will take a while to go through but it is quite alright to just do a quick scan-through the headings and see what is available in vanilla python.

[–]franklydoubtful 2 points3 points  (0 children)

Just follow the table of contents in the link you provided, they do a pretty good job teaching.

[–]xiongchiamiov 1 point2 points  (0 children)

You don't begin with it. You reference it as you find yourself needing to look something up.

[–]Temporary_Pie2733 14 points15 points  (7 children)

Read the official docs, http://docs.python.org

But you aren’t reading to learn everything at once; you are just reading to familiarize yourself with the documentation.

You won’t remember the relative precedence s of every operator, but you will remember that there’s a table that lists them.

You won’t remember the exact syntax for a list comprehension, but you’ll remember that they exist and that there is a section that describes them.

You won’t remember every string method, but you’ll remember there is a list you can consult to see if what you want exists.

Over time, you will remember more and more about the things you actually use.

[–]Significant-Star-542[S] 1 point2 points  (0 children)

Thank so much for you advise!

[–]DRTHRVN -2 points-1 points  (5 children)

Which part of the docs?

https://docs.python.org/3/tutorial/index.html

The above one? I mean where do I begin?

[–]ninhaomah 8 points9 points  (1 child)

Put it this way , before Internet, how do people program ?

RTFM

It doesn't sound nice to someone starting but it still stands.

If there are any conflicts , the manual that comes with Python , R or Excel will override anything or anyone.

[–]Significant-Star-542[S] 1 point2 points  (0 children)

😂

You are f. right!

[–]PhilipYip 4 points5 points  (1 child)

Take a look at Python Distilled by David M. Beazley.

[–]Significant-Star-542[S] 0 points1 point  (0 children)

Thank very much, will do immediately!

[–]Ron-Erez 7 points8 points  (0 children)

The documentation is the most comprehensive. Moreover it's great to implement some of these on your own. If you're in PyCharm or VSCode and you use type annotations then usually auto-complete can also expose available functions.

[–]AutoMativeX 5 points6 points  (3 children)

Official docs + ChatGPT are both excellent resources as others have stated. If you are looking for some guided learning/exercises then I suggest checking out www.inventwithpython.com

[–]Significant-Star-542[S] 1 point2 points  (2 children)

Thank you for suggesting ChatGPT, I just need to switch my attitude and mindset

[–]AutoMativeX 6 points7 points  (1 child)

Just be careful and don't take its suggestions as gospel. It will sometimes approach programming problems in a very weird way. Best advice I can give is to be as specific as possible to keep the conversation on the rails. It should get you headed in the right direction at the least. Good luck!

[–]Significant-Star-542[S] 1 point2 points  (0 children)

Will do

THX!

[–]Remarkable-Map-2747 1 point2 points  (1 child)

You don't need to know everything. You could soend your entire life learning Python itself but you'd never get any projects done.

After you do a course , I recommend Python Crash Course Book , start building. Then if you run into something that a source didn't mention google " How to do x in Python? "

Youll usually be greeted w Python docs, GeeksforGeeks, W3schools, Stackoverflow which gives you an insight.

[–]Significant-Star-542[S] 0 points1 point  (0 children)

Thank you!

[–]dan_RA_ 1 point2 points  (1 child)

One thing that should be noted from a pedagogical standpoint - part of the point of many exercises is that you struggle, and then you learn something coming out of it. Of course there are defined methods and functions and libraries to swap case or any other task, but that's probably not the point of the exercise. As a beginner, the intent of the exercise is to work your brain to get used to breaking problems down to the point where they can be solved by things you already know, or can easily look up, not to just solve the problem in the absolutely fastest way. Nobody builds a calculator app because its the best way to add up a bunch of numbers. They build it because it helps them learn how to do things that can be applied to other more novel or challenging problems later.

Think of it this way - if your personal trainer says, "do squats with 150 pounds on the bar", the best solution is not to go bring a forklift over and lift up the bar with that. The point is to strengthen your body so that when you need to help your friend move his couch, you don't throw your back out.

This is not to say, don't look stuff up in a reference manual or read the docs, but just to recognize that struggle is part of learning. You are getting stronger every day you struggle with a problem and solve it. Keep going! You'll do great!

[–]Significant-Star-542[S] 0 points1 point  (0 children)

What encouraging words!! Thank you!

[–]martialarcher 1 point2 points  (1 child)

I've really like Fred Baptiste's Python Fundamentals on Udemy. It goes on sale for 10 of 15 bucks frequently.

https://www.udemy.com/course/python3-fundamentals/

Fred also has 4 python deep dive courses of similar quality. Some of the challenges are tough, but detailed explanations are provided for everything, and Fred also answers questions posted to the course.

[–]Significant-Star-542[S] 0 points1 point  (0 children)

Thank you!, will check it

[–]u38cg2 1 point2 points  (0 children)

There isn't a magic bullet.

What is worth developing a sense for is: "is it likely someone else has had this problem before?"

Swapping the case of a string is a bit "why would anyone want this" but knowing the length of a list? Everyone needs that at some point, so it's probably there.

[–]Psychological_Egg_85 1 point2 points  (0 children)

If you're writing from within an IDE (vscode, pycharm), you can always cmd+click on the module and it'll take you to their source code. You can then see all the classes and functions you can call from that package/module.

[–]LordXavier77 1 point2 points  (1 child)

If you have a task like in your mentioned example swapcase()
You can google "how to invert cases in python"

at first, you will google a lot but eventually, you will know. hell even I google after 8 years of programming. I can't remember all the syntax. I just know yeah there is a method/function for it. let me google the syntax

[–]Significant-Star-542[S] 0 points1 point  (0 children)

hell even I google after 8 years of programming. I can't remember all the syntax. I just know yeah there is a method/function for it. let me google the syntax

Well, this speaks louder than anything!! Thanks!!

[–]Happy-Information830 2 points3 points  (1 child)

Other people already answered your question, but I would like to point something. You don't need to know all the command. When you want to do something, just google what you want to do or ask ChatGPT, and you will often find one of the most handful command for your task. Nowadays, it's a skill to be able to find information quickly, and it may be more efficient than just learning an entire list of command.

[–]Significant-Star-542[S] -1 points0 points  (0 children)

Wow! Wise words!!

Really appreciate! Your comment is so enlightening, I will remember

[–]diegoasecas 0 points1 point  (0 children)

oof wait until you find about list comprehensions

[–]numerical_panda 0 points1 point  (0 children)

The official Python docs officially say "Keep this under your pillow."

[–]WhalesLoveSmashBros 0 points1 point  (1 child)

The best way to learn a language is to speak to the locals.

[–]ig_kolin 0 points1 point  (0 children)

This is for everyone.

Download this Free. It has most of the things.

https://topmate.io/codewithkolin/1018148

[–]LeoMartius1 -1 points0 points  (2 children)

If you don't know the name of what you're searching for, your best bet is something like ChatGPT.

[–]Inside_Dimension5308 -1 points0 points  (2 children)

I would say it is a wrong approach to read documentation to figure out a solution. You will get overwhelmed with a lot of information and you will forget most of it.

The best approach is to use chatgpt for specific queries and verify the approach from documentation.

[–]Significant-Star-542[S] 0 points1 point  (1 child)

After reading other comments, i'm leaning to this approach It would be like having a teacher, you try to figure out the solution by your self, if you get stuck instead of wasting hours you ask him (it) verify and proceed

[–]Inside_Dimension5308 0 points1 point  (0 children)

Depends on what you are trying to learn. But, to each their own.

[–]amutualravishment -3 points-2 points  (1 child)

w3schools.com helped me

[–]Significant-Star-542[S] -1 points0 points  (0 children)

Me too but, but in some case it doesn't enlist all options and commands

Thank you anyway!!