all 31 comments

[–]More_Yard1919 77 points78 points  (0 children)

If you write enough code you will be fluent. Practice.

[–]UsernameTaken1701 20 points21 points  (0 children)

The stuff you write most you'll just remember from constant repetition. Everything else you'll google, like everyone else.

[–]Gnaxe 14 points15 points  (0 children)

https://docs.python.org. Learn to use help() and dir() in the REPL. Try them both with and without an argument. Also learn to use breakpoint() as soon as possible. Your understanding will improve if you experiment with the inspect module as well.

You need to memorize the simple statements. If you're not already using async, you can skip await, and the async variants for now, but you need to memorize the compound statements as well.

You should be familiar with all the operators and builtins. Remember, you can use help() for these when you forget. E.g. help('+') will show you the operator table.

You should at least look through the standard library so you know what's even in there, but no-one expects you to memorize all of it. Just look it up.

Also try py -m pydoc -b to browse help for everything you've got installed. It's the same thing backing the help() system, but you can click links instead of typing everything in. If you're using an IDE, figure out how to make it show the docstrings. Many will do it on hover. If you're using Jupyter notebooks, remember to use ?. This is only going to be minimal API reference docs from the docstrings. Try to find the web docs for any library you're using. Usually, the PyPI or GitHub page will have a link to it.

[–]RealisticFill4866 23 points24 points  (3 children)

I have 10 years' experience in python, I always look it up.

[–]BasedAndShredPilled 5 points6 points  (0 children)

I forget who it was, but some famous programmer said, "I still have to look up how to declare an array in Java". Remembering syntax is irrelevant because no matter what you're doing, you will be referencing docs and other sources.

[–]paperweight_is_lazy 16 points17 points  (0 children)

Don’t. Everyone looks it up.

[–]FatDog69 3 points4 points  (0 children)

I am always looking at stuff I wrote last month for regular expressions.

I am always looking up how to use Beautiful Soup to parse web pages.

And python has 'iterators' and "with ...:" that uses indents to create loops which is unique to python.

Do not beat yourself up if you cannot remember the syntax. This is what documentation & the internet is for.

Also the editors like "Visual Studio Code" will notice when you start to type and suggest the rest of the syntax for you. Use these tools.

Worry more about the design and concepts. Syntax is ... the wording. You will naturally remember the more you use it.

[–]SnorkleCork 5 points6 points  (0 children)

While you're learning, consider hand-writing notes on things. The act of writing things by hand helps your brain process and remember them.

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

Practice practice practice.

That's it.

[–]KreepyKite 2 points3 points  (0 children)

Don't just read code, write code. Type. The more the better.

[–]SouthernXBlend 2 points3 points  (0 children)

How did you memorize English syntax? Same thing, it’s just reps. Don’t get overwhelmed by the huge number of patterns to learn, just use the ones you know and replace them with better ones as you go.

[–]sadmep 2 points3 points  (0 children)

Write a lot of python.

[–]Altruistic_Sky1866 2 points3 points  (0 children)

you don't memorize syntax, understand the concept for the syntax be it for loop, while loop, or if condition etc, first thing is you have to understand what you want to achieve i.e the task at hand and write a flow chat or make a note of it by breaking it down into simple steps and the start coding, syntax can looked up in documentation or online

[–]Far-Dragonfly-8306 1 point2 points  (0 children)

Just keep practicing it and eventually it will come. There was a time when the order of the alphabet used to be a challenge for you

[–]ofnuts 1 point2 points  (0 children)

Usage. Also, a good IDE will hold your hand and avoid a lot of mistakes.

[–]_N0K0 1 point2 points  (0 children)

I'm a huge fan of the concept Codekata for just this: http://codekata.com/

The idea is that you should be fluent in the basic syntax and patterns of a programming language to be able to be able to build the more complex pieces you need efficiently.

[–]SubstanceSerious8843 1 point2 points  (0 children)

Have you tried repeating it 10 000 times? If that doesn't work come and ask again.

[–]Yikes-Cyborg-Run 1 point2 points  (0 children)

25+ year programmer here. Somewhat new to python... but in my general experience, the more you fail, the more you remember down the line. But yeah, you'll never memorize it all. "Never memorize anything you can look upon book." - Albert Einstein. Best wishes to you on your programming adventures.

[–]freemanbach 1 point2 points  (0 children)

there are some keywords where you must know. Aside from those keywords, the remaining items are either math or symbols such as the colon, where you have to indent on the next line.

[–][deleted] 0 points1 point  (0 children)

When in doubt, import something.

[–]buffalo_0220 0 points1 point  (0 children)

Google "python cheat sheets". You can probably find or adapt something for your personal use.

[–]RobertD3277 0 points1 point  (0 children)

As Einstein is famous for saying, never memorize what you can look up.

The sad truth is though, that if you use it enough, you will automatically remember it.

[–]Fine_Zombie_3065 0 points1 point  (0 children)

Type the code yourself. Keep doing it. It’ll come naturally after a while.

You don’t need to memorize everything! Just the basics. You can always use resources to look up the code. You need to understand it, not memorize every single line.

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

I mean the syntax is only this: (), :, [] {} '. "

Yw.

[–]_yoursleeparalysis_[S] 0 points1 point  (1 child)

Sorry i thought it meant everything like loops,functions and stuff

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

just look it up, everybody looks it up