Presentation is loading. Please wait.

Presentation is loading. Please wait.

A revision guide for programming with python. 1.A program is a set of instructions that tells a computer what to do. 2.The role of a programmer is to.

Similar presentations


Presentation on theme: "A revision guide for programming with python. 1.A program is a set of instructions that tells a computer what to do. 2.The role of a programmer is to."— Presentation transcript:

1 A revision guide for programming with python

2 1.A program is a set of instructions that tells a computer what to do. 2.The role of a programmer is to create and supervise a program. 3.ALL computers are programs. 4.Microsoft word, Microsoft PowerPoint and Windows 8 are all designed to make the computer work, make presentations and typing. 5.The print function in python allows you to enter your instructions onto the screen. INTRODUCTION TO PROGRAMMING

3 1.A variable is a memory location where you can store data inside it. 2.Some examples of variables are; Numbers, Text, Date and Time. 3.You can change a variable by replacing the data in it with another e.g. Name 1 = ‘Bob’ Print (name 1) Name 1 = ‘Hannah’ Print (name 1) In this code you are replacing the variable Bob in name 1 with Hannah so Bob’s data is thrown away. VARIABLES IN PROGRAMMING

4 1.Functions are helpful in programming because it saves you time as it does one specific task. 2.The max function picks out the biggest (largest) number in a list. E.g. print(max(10,32,42,562,24) in this list it will pick out 562 as it is the largest number. 3.The ‘randint’ function is for when you have the maximum and minimum value for the random number you want. 4.The ‘if’ function checks to see if a condition you specify is true or false. BUILT IN FUNCTIONS

5 1.Selection is a way of making decisions. 2.Import allows you to make the loop randint. 3.For loops create their own counter. E.g. for x in range (3,37,3): print (x) 4.The while loop only prints when the code is true. 5.Iteration is a posh way of saying ‘LOOP’ ITERATION

6 Say if you are making a quiz, you will need to create that quiz with a program For example; Score = 0 Print (“What is 4+4?”) Ans1 = input () Ans1 = int (ans1) Is ans1 == 8: Print (“well done”) Score = score + 1 Afterwards you would need to add different subjects into the quiz, you would need to increase the difficulty of the questions and make even more questions. PLANNING YOUR PROGRAM


Download ppt "A revision guide for programming with python. 1.A program is a set of instructions that tells a computer what to do. 2.The role of a programmer is to."

Similar presentations


Ads by Google