Learn Python

This site will NOT teach you basic Python programming for there are hundreds of excellent sites, videos and books out there that can help you with that. This site is mainly designed to help you learn about the extra commands that are available in EV3 Python that are not available in standard Python, such as commands to interact with the robot's motors, sensors, LCD screen, buttons and loudspeaker. However, I will give you a few words of advice on this page only about learning the basics of standard Python.

Before you study the robot-related commands that are unique to EV3 Python you should get a good feel for standard Python. To get familiar with standard Python you will want run Python on your PC - it is more difficult to work with Python on the EV3 because you have to communicate with the EV3. You will of course need Python version 3 on your PC (version 2 is now obsolescent) - I'm guessing it's already there but you should make sure and install it if necessary

To edit Python programs you can use any text editor but that would be a mistake - it's much better to use an 'Integrated Development Environment' (IDE) since an IDE will give you extra features like help with debugging and 'autocomplete' where you only have to type the first few characters of a word and the IDE will guess the word that you are wanting to type, saving you a lot of time. The Python IDE that I recommend you use is Microsoft Visual Studio Code, which is a free code editor that runs on Windows, MacOS and Linux. I will usually refer to Microsoft Visual Studio Code as VS CodeIt should not be confused with Microsoft Visual Studio which is an expensive product that run only on Windows. The main reason to use VS Code for EV3 Python programming is that an EV3 extension is available for VS Code that makes it far easier to write and run python scripts using this editor than it is with any other. Read more HERE.

Only when you have become used to working with standard Python on your PC should you consider learning about the extra functions that EV3 Python offers - when are ready for that you should read this page.

Online Python Courses
I haven't checked which versions are used by the sites listed below. I am not aware of many Python courses specifically aimed at teens but there must be some out there - please let me know about any good ones you come across! Here is a selection of some of the best known Python sites:
  • Codecademy offers a free interactive course which I have used with my students. You need to set up a free account before you can take the course. The free course is only for Python 2 but at beginner level it is really only the print() function that is very different in Python 2 versus Python 3. In Python 3 you must include parentheses whereas they are optional in Python 2. So in Python 2 you could write print "Hello" whereas in Python 3 you would have to write print ("Hello"). The interactivity of the Codecademy course is nice and so is the absence of ads but the course is rather limiting - it gives you a feel for what Python is like but doesn't really attempt to get you writing your own programs. The way it tracks your progress (once you're logged in) is nice.

  • W3schools.com has a free interactive python course which is good but has ads.

  • Wikiversity Python Concepts course. No ads.

  • Learn Python the Hard Way Has videos but is not interactive. No ads.

  • Learnpython.org is interactive but has ads.

  • Introduction to Programming with Python by Alison / Khan Academy. Free but with ads.

  • Invent with Python seems to target a younger audience, which is rare. Al Sweigart kindly makes available free the content of several of his books about Python, Scratch and more. Not interactive. No ads. Based on Python 3. 

  • Alison has a free short (5 hour) course on Python

  • The Python Tutorial. This is the official tutorial on python.org but it's not interactive and teens will find it hard work. No ads.

  • The Hitchhikers Guide to Python suggests many more courses for beginners.
Comments