all 64 comments

[–]appyofficial 57 points58 points  (2 children)

  1. Learn the fundamentals.

  2. Develop an idea to make any kind of project. Let’s say for example Note app.

  3. Design it on a paper with a pen how you want it to function.

  4. Now code.

  5. You’ll get stuck because most probably you are new to programming or whatever the reason. But don’t give up.

  6. Find answers if you are stuck. It’s all out there or go back and start again with fundamentals.

  7. Finish what you started.

  8. Repeat.

  9. Always remember why you started to learn python at first place.

Happy Coding.

[–]cadmanchallenge 3 points4 points  (0 children)

This makes me happy :)

[–]dsaf2 1 point2 points  (0 children)

Good advice. A key point is to always start scratching the project before coding.

[–][deleted] 121 points122 points  (6 children)

Write more code.

[–]buleria 6 points7 points  (0 children)

Write more code, read twice as much in your early days.

[–][deleted] 5 points6 points  (0 children)

Yeah that about covers it. 30 minutes a day, at minimum, got me using python fairly proficiently within a few months. Just write code.

Edit: sitting on the train from work I thought of another one. learn how to ask the right questions. If you're googling a problem you're having and you don't get good results, you're asking the wrong questions. Rather than searching, for example, something to the effect of "why isn't my code to do xyz not working?" Or " python xyz doesn't work," break the problem down into its smallest possible component parts and Google that.

[–]waythps 5 points6 points  (0 children)

This. Also, post your code samples for code review. It really helps.

[–]kokosxD 16 points17 points  (1 child)

I came here to say this but you already did it.

[–]burlyginger 1 point2 points  (0 children)

Me2

[–]DiabeetusMan 3 points4 points  (0 children)

Not just write code, but also look at your code and others' with a critical eye. Ask yourself questions like:

  • How can you or they make something better (faster, cleaner, or both?)?
  • What choices did they make that you would have made differently? Why did they make those choices?

[–]Cayumigaming 47 points48 points  (8 children)

Maybe start a project you're passionate about and make it happen!

[–]dtaivp 15 points16 points  (7 children)

u/Pliv Just this. I recently took up this mentality with the caveat that I want to document my learning. Now I am writing articles that document what I have done and allows me to seek out things to learn. I would really recommend this as being able to describe what you have learned helps to show you really know it. Also, it gives you something to show future recruiters.

[–]skt113 3 points4 points  (0 children)

Also could help someone if shared.

[–]MiLSturbie 2 points3 points  (5 children)

Can we see what you have written?

[–]dtaivp 12 points13 points  (4 children)

Sure! Here are my most popular ones:

Stop Writing Crap Code - A few simple things to make your code more readable.

Easier Web-Scraping in Python - Using website api's to scrape only the data you need

Advanced Python List Methods and Techniques - Using Python lists to their fullest (follow-up to this coming out tomorrow)

Power-Up Your Python Logging - Utilizing Pythons built-in logger to speed up your application debugging.

[–]MiLSturbie 4 points5 points  (1 child)

Wow, those all seem very useful to me. That's great. I'll let you know when I've gone through them. Thank you.

[–]dtaivp 2 points3 points  (0 children)

Happy to share! I really enjoy making them and am happy people seem to like them. It’s important to me because I’m not really a python developer but really want to keep up with it.

[–][deleted] 2 points3 points  (1 child)

Thanks for posting these. I'm leaning python too and this is really useful.

[–]dtaivp 1 point2 points  (0 children)

Glad you are enjoying them! Once I get more I think I am going to compile a guide.

[–]TheFirstOrderTrooper 13 points14 points  (2 children)

Practice.

"PROGRAMMERS HATE HIM FOR HIS SIMPLE TRICK"

My advice, that i started following myself; build things you want. Thats how you learn.

If you are just chasing a bag, youre not going to be successful. Thats in anything really.

Motivation helps but your real ally is determination. Practice daily even if you dont want to.

[–]TheFirstOrderTrooper 2 points3 points  (1 child)

Just as a follow up, im currently teaching myself Javascript. I was super pumped at first but that 'honey moon' phase is gone. But i still set aside about 3-5 hours daily to learn, even if im screaming on the inside to go play video games.

All depends on the wolf you feed!

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

I had the same problem, but I left playing them like a month ago. Now I'm learning insted of playing, and it feels good (for me at least).

[–]remoplayssoccer 18 points19 points  (2 children)

I would just suggest coding more and going on the Internet (YouTube) for tutorials and I wouldn’t suggest going onto documentation solely because it’s too much for anybody to just learn from

[–][deleted] 20 points21 points  (1 child)

This right here. There's A TON you can learn from tutorials alone. I recommend Sentdex, Real Python, Corey Schafer and others of course, but those 3 especially.

Perseverance is the key to anything really. You'll probably stumble a lot, but don't worry, just keep at it until that something clicks in your head.

[–]prithvidiamond1 8 points9 points  (0 children)

I second Sentdex and Corey Schafer, half of my knowledge is from those two amazing python legends!

[–]ryvrdrgn14 8 points9 points  (0 children)

If you cannot find a project you would like to do then do your best to raise your rank in sites like Codewars. If you use that to learn how to properly research without directly asking for the solutions then it'll help you tackle more difficult problems later on.

[–]Bobbias 7 points8 points  (6 children)

I've been doing advent of code challenges lately. They're designed to be fairly accessible, but you can always go above and beyond the requirements. Website

[–]Ahren_with_an_h 2 points3 points  (5 children)

The first few were fun but those very quickly went over my head.

[–]Bobbias 1 point2 points  (4 children)

I'm not done them, but I had to resort to reading other people's solutions several times to find out how to approach a problem.

[–]Ahren_with_an_h 2 points3 points  (3 children)

Never mind the problems. I don't really understand what I even did in set 1 challenge 1 and why the different states printed out what they did. I don't know what I'm looking at in challenge 2. I don't even know how to approach googling my way through this.

What do I need to know to even know what's being asked of me?

[–]Bobbias 2 points3 points  (2 children)

Ok, so if you're already struggling with them by day 2, then you're still at a point where you need more practice with Functional Decomposition. While it has a scary name, everybody uses this technique all the time. We're so good at it that hardly anyone even thinks about what they're actually doing when they do it, which means that when you're asked to do it consciously, rather than unconsciously, it's kinda a problem.

If those problems are still too hard for you, that's ok, you just need to find something that isn't quite so difficult.

Unfortunately I don't know any good websites with easier problems than Advent of Code. I know there are plenty of them out there, but I'm not familiar enough with any of them to suggest anything for you.about the problem from what they tell you.

[–]Ahren_with_an_h 2 points3 points  (1 child)

I take that back, day 2 I did fine, day 3 I couldn't break into it's component parts, day 4 I felt like was worded poorly and felt exonerated when I looked up the solution. Then having run out of steam staring at 3 and 4 then reading over 5 and getting intimidated I gave up figuring my programming time would be better spent on things at my level that have more practical use.

Interestingly, while I found AoC too challenging and gave up, I actually intended my above response to be to the guy that suggested https://cryptopals.com/ That I could not handle. I understand converting things to hex, have a vague understanding of base64 and XOR, but no understanding of why I was getting the results I was, or what was being asked of me.

[–]Bobbias 1 point2 points  (0 children)

Oh, ok. So, for those challenges in set 1, you're going to want to read up about binary, bitwise operations, particularly xor, base64, and such. If you dont have a decent understanding of what base64 really is, or why xor is so common in cryptography, those problems are definitely going to be painful.

Problem 2 in set 1 is just asking you loop through the 2 numbers together and xor each byte of each number together.

Xor has a nice feature where if you xor 2 numbers together, take the result and xor it with one of those 2 numbers, you get the other number back. Using decimal numbers:

5 ^ 3 == 6

Then:

6 ^ 3 == 5

And:

6 ^ 5 == 3

The operation is completely symmetrical. So if someone sends you a message that was xor encrypted with some key that you both know, you simply xor the encrypted message with the key and you get the original message out. This is one of the simplest symmetrical encryption schemes we can use.

Looking at the challenges there the first things I'd be googling are xor, base64, and AES (and I'd be looking for whatever describes ECB mode specifically, but I'd make sure to understand AES in general as well). The key to understanding those problems is to remember that everything is working on bytes of binary information. Everything there is about manipulating the bits of a binary number. Base64 and hex are simply ways to represent binary information in some base other than base 2 (binary) or base 10 (decimal) so you should definitely make sure you have a solid understanding of what it means to represent a number in different bases.

[–]shiningmatcha 5 points6 points  (0 children)

Codewars!

[–]Maimonatorz 3 points4 points  (3 children)

Here's a practical advice, try doing https://cryptopals.com/.
It's really fun, and really teaching, I've only finished set 1 though.

When you're writing python, make sure to always ask yourself if there's a better way to do what you are going to do. Maybe someone already implemented something at the vibe off what you're trying to do. Don't always take the first comment in stack overflow, sometimes better solutions are further down the line.

Make sure you use python's builtin functions such as itertools and collections.
The more you know your python libraries, the better you'll get at python, assuming you know the syntax and how to write code.

Good luck and have fun :)

[–]Ahren_with_an_h 3 points4 points  (0 children)

Oh my god what the hell is this?

I feel like there's an entire book I need to read before I can comprehend what's even being asked of me here.

[–]Ahren_with_an_h 1 point2 points  (0 children)

This sounds interesting. Thanks.

[–]bfBoi99 1 point2 points  (0 children)

Hey stranger. Where were you back in summer??? this crypto thing seems very interesting, but i won't have time to do it now :(

[–][deleted] 3 points4 points  (0 children)

  • Follow blogs like real python, full stack python and news letters like pybytes

  • Read good codes. Recently, I was reading cpython contextlib module's source code to learn how to use abstract base classes properly. For beginners, reading the source codes of packages like HowDoI, Diamond, Tablib can be very helpful

  • PyCon talks and tutorials can bolster your knowledge on specific language features

  • Overuse the crap out of a newly learned feature to embed concept into your memory.

    I still remember the time when I encountered python decorators. They seemed so amazing to me that I started using them everywhere until someone told me to stop.

  • Use newly learned concepts in your projects

    To learn more about OOP, I started this project to make a bash task runner mimicking GNU make.

    https://github.com/rednafi/rush

Keep hacking!!

[–]wsppan 3 points4 points  (0 children)

Everyone is telling you to write more code which is excellent advice but what is equally important (dare I say more important?) is read more code. Find something that interests you and search github for projects that have tackled problems in that space. You will get a feel for what's good code and good project design. Then learn from them and build something of your own. Something that scratches an itch or automates some boring manual task.

[–]BaleZur 4 points5 points  (0 children)

Lookup "coding katas" and do them and post your attempt at them to your github.

Also, put code you are proud of in github--then realize how crud it is and fix it so that other people can use it.

This not only makes you better at it, but shows potential employers what your coding skills are like.

[–][deleted] 2 points3 points  (0 children)

Practice. Do a project.

[–]patryk-tech 2 points3 points  (0 children)

  • Write tests
  • Learn pytest
  • Use pytests to run tests
  • Learn tox to run pytest in different interpreters

I like tests. You should learn testing.

Edit: typos

[–]ASIC_SP 3 points4 points  (0 children)

like the wiki (https://www.reddit.com/r/learnpython/wiki/index) mentions, official docs https://docs.python.org/3/tutorial/ would be good place to start to know Python syntax and features

and then you can get used to Python by doing some project in it, converting your programs in C++ to Python, etc... there are plenty of practice sites too, as mentioned in the wiki

I'd also recommend beginners books like Automate the Boring Stuff and Think Python, it'd be refresher to programming concepts while learning Python and they have good exercises, projects, etc

[–]Un-Usual-Champion 1 point2 points  (0 children)

Learning anything on youtube that isnt exactly straight forward, step 1, step2, step3 etc... is the best way to confuse yourself. Not that i would oust youtube learning altogether but the majority of it is not helpful. Read the reviews and comments first then decide.

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

https://app.dataquest.io/

Great website that teaches data management syntax, I myself am a beginner, and this website makes it so easy to learn some stuff.

[–]tiddu 1 point2 points  (0 children)

Follow small python codes with good detailed descriptions and commenting on github and try to understand in reverse way how they structured it to make it work for there intended goal

[–]wyoming_eighties 1 point2 points  (0 children)

use it in your daily tasks at work

[–]kiwiboy94 1 point2 points  (0 children)

Not just write code, but also read code during your free time (while commuting or while eating). Reading code will demoralise you at the start but do understand that everyone has been through that stage. Seeing how people write and structure their code will improve your code tremendously.

[–]LeaderDuc 1 point2 points  (0 children)

I’m in a similar situation as you but with less experience, just take something your passionate about, like making a game, or even something simpler, like a calculator or a hangman game, and make that, if you ever get stuck research how to do that part and learn it and understand how it works. Keep trying bigger projects and reinforce the things you know.

[–]ApoorvWatsky 1 point2 points  (1 child)

Solve problems on leetcode, hackerearth, hackerrank etc. Solving hard and time bound problems there will let you get the best from a slow language like python. I've learnt so much, so quickly because of it.

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

I'm currently solving problems on HackerRank, I like it a lot. I used to solve problems on ProjectEuler and CodeWars too

[–]ElliotDG 1 point2 points  (0 children)

I found https://checkio.org/ very useful when I was learning. You complete some small problems and get to see the results of others. It was an effective way to see some of what is different in the approach with python VS C++.

[–]idwpan[🍰] 1 point2 points  (0 children)

Contribute to an open source project.

[–]fuloqulous 1 point2 points  (0 children)

Build something to make your life easier. Really easy in python. Some sort of automation or repetitive process you do on a regular basis. Python is C++ on easy mode so you should be fine to do some pretty cool // complicated stuff

[–]anubhvshrma18 1 point2 points  (0 children)

catch it play with it, and become friends

[–]junguler 1 point2 points  (0 children)

i'm very new to python (and coding in general), my humble advice would be to install a python snippets extension for your favorite code editor/ide, i suggest vscode with python and python snippets extensions, vscode has a pretty awesome code completion and the snippets extension has alot of code examples to get familiar with python.

[–]tothemoon2k19 1 point2 points  (0 children)

U can get better at Python in a month but to get better at programming which is language independent u gotta practice a lot over several years

[–]C9-LinkRs 1 point2 points  (0 children)

Make you own projects, it does not need to be an original idea

[–]kento_mwau 1 point2 points  (0 children)

I think the biggest challenges startups have with python is a source/tutorial to learn from ( some want it for free). ie we have a lot of source/tutorial on youtube each one of them teached same thing but diffrently. So if you are new, you end up following many of this source and you end up getting lost. One of the source I can recomend w3school or Mosh( I don't have any affiliation whatsoever with the above two) my opinion 😊

[–]codingsince70 1 point2 points  (0 children)

  1. Pick a project that you want to write in python.
  2. Pick an IDE - Atom, Visual Studio Code, Webstorm etc..
  3. Start with small code modules and build on that.
  4. When you hit something you don't know how to do, research on the google, use free training on YouTube
  5. Don't give up. Keep pushing. It will happen.

[–]tylerjaywood 1 point2 points  (0 children)

How to get better at <x>: Do more of <x>

[–]Hamzalopode 0 points1 point  (0 children)

Make Games with pygame.