r/learnpython • u/Worldly_Childhood983 • 1d ago
I already know Java and want to learn Python. What are some of the best resources?
I took up CS extensively throughout high school and generally enjoy programming with Java. I'd say I have an intermediate to upper-intermediate proficiency in Java. That being said, I know little to nothing about Python and would like to learn to code in it as well. I think the logic should be the same since they're both OOP languages.
I looked at some CS50P and the MOOC courses but they start right from the begin and are aimed at those who have 0 programming experience, so I kinda got bored. What do I do?
4
u/ee_control_z 1d ago
I strongly recommend this book.
Learning Python, 6 Ed, Mark Lutz
It covers just about everything you need to know about Python from beginner level to advanced and everything in between including object-oriented programming. It is very well written so it is easy to understand and follow along.
Have your editor open to work out problems as you're reading - there are tons - so a lot of practice.
1
u/Stock_Test2326 19h ago
Effective python Vs Think Python Vs Learning Python Vs Fluent Python
I have these pdfs but dont know which one or in what order to start, as an beginner.
I already finished reading Python Crash course and reading Think Like a Programmer book now.
2
u/ee_control_z 19h ago edited 10h ago
"I have these pdfs but dont know which one or in what order to start, as an beginner."
In my opinion, Learning Python is the gold standard. I would go with this one because it is so thorough. It literally covers just about every topic in Python. Every topic prepares you for the next topic. At no time in any topic did I ever feel as if I was not adequately prepared.
1
2
u/Available_Safe1818 1d ago
Start making stuff. Use google. You should be able to handle that at this point.
2
u/PureWasian 1d ago edited 1d ago
Indentation matters. Dynamically typed language. Look up tuples, and understand how to write pythonic list initializations and filterings as one-liners. Also look up how they do ternaries and the syntax to loop on a list with "for item in x", or "for idx, item in enumerate(x)" or "for idx in range(len(x))". Things are pass-by-object-reference. Truthy/Falsy is a thing. Not everything needs to be a class or OOP in Python, you can script more for smaller tasks.
Note that default function args only run once on initial function declaration, so if you modify them they stay modified, even after leaving the function scope.
Learn how to use pip and/or uv for any external packages you want to use. installing/importing is generally easier than bundling stuff into jars with very lengthy path names.
You don't do a separate compilation step in Python. You literally just have python installed and on your device's PATH and then you can call python your_filename.py to run it
If those make sense to you at a high level, you're already onboarded without a course. Google/LLM any specifics at that point and go from there as you build things.
1
u/_Happy_Camper 1d ago
I got AI to generate a learning path of topics and then worked my way through that trying different models to generate each chapter, with examples until I thought I was getting the vibe of it.
I’ve experience in C/C++, JavaScript and go (which I also learned with AI assistance) though - although Java has been my main language for years so that was what I prompted the AI with - so it didn’t take too long
1
u/cyrixlord 1d ago
i have been coding in python and c# for over 11 years. I still dont 'know' either language. Pick a project you are interested in and just start doing it, learning along the way. If you are just learning things without applying anything, you're going to forget in 6 months.
1
u/Top-Cauliflower-1808 1d ago
Skipping beginner material because it feels boring can leave gaps in Python-specific idioms that Java does not teach. Building a small project that forces you to read other people’s Python code will teach you more than jumping to advanced courses.
1
u/roelschroeven 23h ago edited 23h ago
As already mentioned, as you already know programming the best starting point is probably the official tutorial at https://docs.python.org/3/tutorial/index.html. After that, have a look at the built-ins reference (https://docs.python.org/3/builtins/index.html) and the library reference (https://docs.python.org/3/library/index.html), if only to get an idea of what's available.
Other than that, there are two more resources I would like to recommended.
I like Raymond Hettinger's presentation "Beyond PEP 8 -- Best practices for beautiful intelligible code". It's not really about coding in itself, but more about how to take advantage of the way Python works to make code more readable and concise.
Learning a language is not just about the learning the syntax and semantics, but also the idioms, the style, learning to work with the language and the ecosystem rather than trying to go against it. Python and Java are quite different in that regards, and I think this presentation sheds some light on that.
You can find it here: https://www.youtube.com/watch?v=wf-BqAjZb8M
(PEP 8 which is referenced in the title is Python's style guide, which is probably worth reading too. Raymond's point in the presentation is that writing idiomatic Python goes further than blindly following the style guide. PEPs by the way are Python Enhancement Proposals, more or less comparable to RFCs in the Internet world, and they describe many newly introduced language features.)
Another useful presentation is Ned Batchelder's presentation "Python Names and Values". It explains how names and variables and assignments and all that stuff works, and that's important because it differs quite a lot from Java. You can find it here: https://nedbatchelder.com/text/names1
1
u/justanothersnek 2h ago
Dont do Learning Python, that is way too dense. Instead, check out Introducing Python by Bill Lubanovic. You'll thank me later.
0
u/riklaunim 1d ago
Just note that language itself is of little value if you want to get a job or do anything non-trivial. Learning some Java software stacks in a niche that is of interest to you could be a better idea.
0
0
0
u/Pentium_D_2005 1d ago
I finished reading Suma Theologiae, who can teach me the Bible type post this is
anyway i kinda like w3schools tbh
very good at simplifying stuff
9
u/Adrewmc 1d ago edited 29m ago
One of the best things about Python is how great its documentation is so I would suggest
https://docs.python.org/3/tutorial/index.html
“Python Tutorial
Tip This tutorial is designed for programmers that are new to the Python language, not beginners who are new to programming.”
—-
All tutorials have some mandate to start at the beginning so does this one, but honestly you could read this in a day or two. It is extremely no nonsense, and brief on every topic.
If you want a clear quick overview as someone who knows how to program get it right from the source.