I Haz Codes

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Menu
Mini exercises
Code boot camp
File handling
Strings
Pygame tutorials
Installing python and geany
Variables and I/O
IF statements
ELIF
Binary logic using IF
random numbers
While loops
Arrays
Using arrays
Learning python

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!

Mini exercises

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  

Code boot camp

In this section you will find some basic coding tasks to get you started

File handling

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.

Strings

This section will contain tutorials on how to use strings in python.

Pygame tutorials

Pygame is a brilliant python library which will teach you how to create your own games as well as develop your multimedia coding skills.  

Installing python and geany

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 and I/O

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

IF statements

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 […]

ELIF

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 […]

Binary logic using IF

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 […]

random numbers

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 […]

While loops

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 […]

Arrays

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 […]

Using arrays

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

Your email address will not be published. Required fields are marked *

Information