Python is a great language for learning the basics of programming. There are so many websites out there which will help you. Why not have a quick look? See what you can find out!
The next few pages will teach you how to do some coding. Each page will have a small task todo in order to send you to the next page. It will explain how to write the code and all you have to do is ensure you enter the correct code and run. Simple!
The above links will take you to mini tasks which you can try your python knowledge out on. You will not get any points for doing them but it is a great way of testing how well you have followed the basic tutorials
In this section you will find some basic coding tasks to get you started
File handling in python is all about manipulating strings. It requires you to think differently about your I/O operations. Instead of printing to the screen, you write to a file. Instead of using input, you read from a file.
This section will contain tutorials on how to use strings in python.
Pygame is a brilliant python library which will teach you how to create your own games as well as develop your multimedia coding skills.
The video below will show you how to install Geany and Python. The links to the key files and extra help can be found under the video. Download link to python – http://www.python.org/getit/ Download Geany – http://www.geany.org/Download/Releases Setting up Python – 1. Download the version for your computer. It is advised to download version 2.7 which is […]
Variables allow you to save a value for later use. This later use may be to display it or to perform further calculations. Whatever the reason variables form the backbone of most programs. Helpful links todo
About IF If statements allow you to change the flow of your program. It allows you to test a condition, test what the user has entered or evaluate the current state of your variables. Fundamentally an if statement will allow you to run specific code if a condition is true or not. The condition must […]
Syntax if a > 59 : print 'True block' elif a > 80 : print 'runs only if the second condition evaluates to true' else : print 'False block' About elif elif allows you to chain together multiple if statements. It will only ever run one of the statements which is different […]
Syntax if a < 0 and a > 10 : print 'True block' else : print 'False block' About binary logic and IF Binary logic uses AND, OR and NOT to link together conditions in if statements and loops. Understanding binary logic is crucial if you want to use if statements effectivly. Below […]
Syntax print random . randint ( low , high ) About random numbers Note – You must import random before using random numbers. Random numbers are produced in python by using the random module. The video below demonstrates how to use one function from the random module, randint(a,b). Random numbers on a computer are actually […]
About While While loops allow you to repeat code. In order to repeat code you need to know when the code should start, when it should end and how many steps it must take from start to end. This is an over simplification but it helps when first starting out with loops. Key term Iteration […]
Syntax arr = [ 32,54,11 ] About arrays Arrays allow you to store multiple values into a single variable reference. This makes the manipulation of the data held within the array much simpler by the use of a loop. The sample code is taken from the video. Key term Data structure – a specific way […]
Syntax arr [ 2 ] = 43 List Vs Array Python uses lists not arrays. However a lot of the GCSE and GCE exams will make reference to arrays. It is important that you understand the difference. The key differences are – Arrays have a fixed size while lists are variable Arrays do not have […]
Leave a Reply