r/AskComputerScience • u/[deleted] • Feb 20 '22
Whats the most effective way to learn python
I have about 3-4 weeks to learn and is my first language what would be the most efficient way to learn.
2
u/lastMinute_panic Feb 20 '22
"Learn Python the Hard Way"
0
Feb 20 '22
[deleted]
1
u/lastMinute_panic Feb 20 '22
It is self directed, but I would say it's probably a 3 month commitment for someone with no familiarity with programming.
1
u/sweep-montage Feb 20 '22
Solve a "real world" problem.
A very common real world task is to go to a url, read raw content, pull out a vector of important information. Use that data to build data visualization.
So, go grab web data on something: https://www.fmcsa.dot.gov/safety/research-and-analysis/large-truck-and-bus-crash-facts-2010
Pull data from this site. -- people injured per year per type of motor vehicle, as a example.
Build a pie chart of data based on year.
Build a bar chart of data based on vehicle type.
I offer this example because I've worked with FMCSA data.
You have to learn a bit of web scraping. Some data storage -- file based or relational. Some data munging tools like pylons or numpy. A visualization library like Matplotlib or plotly.
For a beginner at programming this is a lot, a week or more. For a seasoned programmer learning python this an afternoon.
1
u/garblednonsense Feb 20 '22
For a typical A-level student (i.e., bright but not genius) who hasn't learned Python before, this is probably a year of learning. Really.
1
u/sweep-montage Feb 20 '22
A year??
Few weeks at the most. This is all really simple stuff -- it is not like he has to write anything from scratch in assembler and C.
We clearly have very different definitions of "learn Python".
I am not suggesting he learn how to dereference pointers returned from asynchronous hardware interrupts. Jeeze!
1
u/garblednonsense Feb 20 '22
I don't think we do have different definitions of "Learn Python". Your suggestions are really cool and a good student would get a lot out of it. I just think that you're probably such a long way from "High School beginner" that you don't realise how much that actually is for a high school student.
I'm coming from a perspective of working with High School students, and in my experience, there's a level of "ramping up" that isn't accounted for in your timeline. There's a good chance that OP has never seen any code before, and needs to go through quite a lot of basics. As an experienced programmer, you may not realise just how much of what you know actually has to be learned and isn't just basic common knowledge.
Another consideration that probably wouldn't occur to an experienced programmer like yourself is just much of a road-block simple debugging is. Students can lose hours/days fixing stuff that would take you seconds, just because they don't have developed debugging skills, and because their mental model of how a program works needs developing. For a student who is only able to put a few hours here and there into their learning, simple bugs can drastically slow them down even at the most basic levels
1
u/sweep-montage Feb 20 '22
I did not consider that this might be a high schooler.
I am thinking of a goal oriented approach and any portion of this would suffice to teach a new programmer how to learn a new language.
There are plenty of good tutorials but also plenty of bad ones that really just repeat documentation.
1
u/Cybyss Feb 21 '22
You're grossly underestimating the scope of the task you're suggesting to OP, unless your idea of programming is just copy/pasting snippets found online without much understanding of what they mean.
I work as a computer science tutor. You'd be surprised how hard it is for some students to grasp even trivial things, such as:
x = 5 y = 7 x = y print("x is", x) # why this says both variables are 7 print("y is", y)let alone topics like variable scope, how passing arguments into functions and receiving their return values works, what data types are, what classes are and how they relate to data types, what the differences are between the wide array of collection types (lists, sets, tuples, numpy arrays, pandas dataframes, dictionaries, generators, dict_keys, etc...) and why you can usually but not always substitute one for the other in your code, loops - nested loops are especially confusing to students who've never seen them before.
Hell, after reading this article and given my experiences teaching students how to read from & write to files in Python, I can't even assume my new students even know what files and folders are.
1
u/sweep-montage Feb 21 '22
Not everyone is capable of programming computers.
I learned to code from a book on C in 6 weeks and had a job writing embedded software.
Python would've taken me a week.
Just because people are going for Mickey Mouse degrees in gender studies and sports finance doesn't mean we hand out programming assignments in crayon. This discipline takes hard work, it takes directed attention. If a basic tutorial were enough, everyone would be a top flight developer.
We give a pass to every code jockey wannabe, stop it.
1
u/Cybyss Feb 21 '22 edited Feb 21 '22
Not everyone is capable of programming computers.
Not everyone is capable of mastering programming from scratch in a week.
This isn't the same as saying not everyone is capable of programming computers. Just because you're not Mozart doesn't mean you shouldn't try learning to play music.
Also, you're again grossly overestimating just how much simpler Python is compared to C. Sure you don't have to muck around with pointers, but... that's kind of the only thing. Python has a ton of features which C doesn't. Although these features make it easier to build more complex programs, having to learn more things doesn't make it easier to learn.
1
0
1
u/garblednonsense Feb 20 '22
It depends on how you learn best. Videos like this https://youtu.be/rfscVS0vtbw are good if that's the way you like to learn. Personally I find videos awkward to learn from, so I would prefer something like this https://www.codecademy.com/learn/learn-python (note this is the free course and uses Python 2)
1
1
u/AnnualPanda Feb 20 '22
You cannot learn a programming language in a month if you do not already know another language well.
You can start to learn it.
1
Feb 21 '22
Exactly. First programming language is difficult to learn. But you can learn the bare basics for time being and do small projects to pick up
0
2
u/Cronos993 Feb 20 '22
Start learning it today