# Learning Python

Python is an interpreted high-level programming language for general-purpose programming. First released in 1991, Python has a design philosophy that emphasises code readability, notably using significant whitespace.

TIP

If you don't know Python, why not try out Blockly? It's just as powerful, but lets you use a simple drag and drop interface to program the robot - and if you have any struggles with it, why not drop us an email! We want to make it as easy for you to get started as possible.

There are many resources online for learning Python, here are a few good ones that we would recommend:

  • Student Robotics' tutorial has a tutorial called Python: a whirlwind tour. This was written for Student Robotics competitors (a similar competition to the one you are taking part in), and explains the basics while trying not to overwhelm you.
  • CSNewbs has a very comprehensive tutorial, that takes you through from the basics to the slightly more advanced. The later chapters cover things like File Handling and UIs - you shouldn't be using these on your brains, but go wild on your own devices!
  • The Official Python Tutorial can be pretty handy - the good stuff starts at chapter 3, but you should at least skim the stuff before it; there is a lot there and it may be a little overwhelming.
  • A number of tutorials for beginners are linked to from here.
  • Learn X in Y minutes is quite nice if you've programmed before in another language and just want to learn the syntax. (Tip: If you're trying to complete the challenges, here's where we say you can learn Python in "Y" minutes)
  • The Official Docs can be handy, but a little dense! Give them a shot, but don't worry if you can't find what you are looking for.

WARNING

Running code on your brain may have unintended side effects if it does not call import robot, and doesn't create a robot object (R = robot.Robot()). Its best to leave those lines in, even if you don't need to run anything related to the hardware on the brain.