How To Learn Python
How to Learn Python
Issues & Effective Learning Techniques
by Paul F. Watson
My Experience: I began my programming journey back when computers used the 'Basic' programming language. I watched the takeover by powerful languages including Pascal, C, Java, PureBasic, Python and others. By day, I worked an engineer and by night I studdied computer programming. I learned Basic, C, PHP, PureBasic, Matlab and now I am working with Python. Below, I share my observations about learning languages that may help you.
Powerful vs. Simple Languages: For me, a simple language is one that has a small number of commands & does not have custom libraries that add many more. Basic is such a language and usually has a total of 100 to 150 commands. Here are some examples for Applesoft Basic:
For such simple languages, you can 'buckle down' and learn all the commands. Programming then becomes a matter of deciding on the structure of your program, the variables & then writing the computer code that achieves your goals.
- print 'hello world';
- for i=1 to 10 ..... next i
- gosub 1350
- and there are about 100 more commands.
Powerful Languages: By contrast, C, Java, Matlab and Python have large collections of commands. In addition, there are dozens if not hundreds of optional libraries that add thousands more. It is hardly practical to learn all of the commands. Thus, a different approach to programming is needed. I recommend the following:
Get a reference book (paper or electronic) that 'speaks to you'. Use it when you need to look up routine stuff.
Use web training material (such as w3schools.com) to learn the essential commands. The basic stuff like:
Have an available computer with Internet capability to look up questions you encounter.
'Learn by doing'. You can not learn a language by reading.
- Printing stuff on the computer screen
- Looping through a group of commands
- Program logic commands (e.g. if x>23 gosub(sortroutine)
- Math operations (e.g. y=23+x)
- You will need to know about 100 of these
- Make sure you have a working computer with the desired language properly installed.
- Make sure you have a way to enter & run computer programs. A simple Integrated Development Environment (IDE) is recommended. (After everything was installed, it took me a couple of hours to figure out how to load, list & run Java code on my I-Mac. Then I could start learning Java. Take heart!)
- Get started writing 12 line programs that do things. Save the 'useful ones' (like sorting data) for future reference. Examples follow:
Have your reference book, or Internet 'at the ready' when you program. Don't know something? Look it up.
Finally, build a medium sized program that does something you want done. It can be a music catalog or a stock market analysis program (or whatever).
Conclusion: It is helpful to know how to learn a programming language. Programming a powerful language is an 'acrobatic activity'. You constantly look up new commands & details of commands while you are programming. You simply can not know it all. You have to acrobatically jump from programming to researching & back. In the middle of a medium sized project, you will jump off & write 'mini-programs' to make sure you understand a command before implementing it into your project.
- Print the message 'Hello World' using your chosen language.
- Ask for the computer user's name & age. Take them in as variables & then print them on the screen.
- Write a program that takes 10 numbers from the users, & then adds them up. Print the sum.
- Write a 'for loop' that adds the numbers 1 to 100. Print out the result.
- Assign 5 numbers using program lines. Sort them into order.
- Whatever else you can think of can be a good practice exercise.
A few years ago, my employer needed some Matlab programming done. I didn't know Matlab, so I took this approach & it worked well. The same approach is working very well for Python. I am confident it will work well for you also!
Contact the author
Copyright 2019 by Paul F. Watson
All Rights Reserved
Dionysus.biz Home Page