Can you learn a programming language so well, that you know exactly what you must write to make the computer, do that and that?
Learning the language isn’t the hard part. The hard part of making a computer do what you want is figuring out the logic that you need to tell the computer to execute.
You can memorize the syntax as if you’re studying for a test (which I find super boring and a terrible way to learn) or you can not worry so much about the syntax and just get a general understanding of it. Whenever you forget certain syntax, just google it or look it up in a book. You DO need to know what to be doing with said method/function and why it works.
If a carpenter needed to build a table, he’d have to go get some wood, a hammer, etc. He knows how to use those tools to create what he needs to make.
The most important part is working your way through a problem and thinking logically. The language alone won’t help you much if you don’t know how or when to use it.
I find it much easier to learn if I think of something I want to make and then learn the things I need to make whatever it was. Programming is above all else a hobby imo, and it’d be a shame to treat it like studying for an exam.