Presentation is loading. Please wait.

Presentation is loading. Please wait.

GCSE COMPUTER SCIENCE Practical Programming using Python

Similar presentations


Presentation on theme: "GCSE COMPUTER SCIENCE Practical Programming using Python"— Presentation transcript:

1 GCSE COMPUTER SCIENCE Practical Programming using Python Lesson 1 – An Introduction

2 What is a Programming Language?
Programming Languages What is a Programming Language? A coded language used by programmers to write instructions that a computer can understand, to do what the programmer (or the computer user) wants. People who can computer program are highly sought after and it can lead to a very lucrative career in the Computing industry. Any program you have ever used on a PC, any games played on a PlayStation or Xbox and any applications (apps) that you have used on your phone have been coded by a programmer, or a team of programmers. Examples of programming languages include Python, Java, C#, Objective-C, C++ and Ruby. There are lots more..

3 Also referred to as an application, or apps for short.
Programming Languages What is a Program? A program is a sequence of instructions that specifies how to perform a computation. Also referred to as an application, or apps for short. We can describe programming as the process of breaking a large, complex task into smaller subtasks.

4 Syntax The syntax is a set of rules a language must follow. It looks different in each computer language, but there are a few similarities between the many programming languages. Get data from a keyboard, a file or some other device. INPUT Display data on the screen, send data to a file or some other device. OUTPUT Perform mathematical operations like addition and subtraction. MATH Perform some actions repeatedly, usually with some variation. REPETITION Checks for certain conditions and executes a statement depending on if the statement is true or false (for example). CONDITIONS

5 Suggested book to help practice with Python programming.
Programming Languages Python Python is a high-level programming language that is often used to develop web applications. The creator of Python, Guido van Rossum named the language after the 1970s BBC comedy series ‘Monty Python’. The Python programming language is what you will be completing your practical programming assignment in, after the winter break in the Spring term. Suggested book to help practice with Python programming. Amazon Bookstore Link

6 Python The Python IDLE Python uses an Integrated Development Environment, or IDLE. This can be found Start / Computer / ICT(I:) / Python / IDLE To create a new Python program you need to open a new window: File / New File Create a folder in your area called GCSE Computer Science Create a second folder called C3 Programming Save all your Python files in your C3 Programming Folder

7 Place a screenshot of your code here
Activity 1 In a new file, try typing the following code, save it as name1 and press F5 to run the program print(“Hello world”) What happens? Now change the program so it writes your name (using one line) on screen. Place a screenshot of your code here Replace this image with your own and delete this text.

8 Place a screenshot of your code here
Activity 2 Write a program that writes your name on screen, this time using multiple lines (first name then surname). Place a screenshot of your code here Save the program as name2.

9 What happens? Now write a program that prints your name six times.
Activity 3 In a new file, type the following code, save it as name3 and press F5 to run the program print(“Hello ” * 10) What happens? Now write a program that prints your name six times. Place a screenshot of your code here

10 Activity 4 Escape sequences can be used to alter how the information is displayed on the screen. Copy the code and find out what these escape sequences do. Complete the table. Save the program as escape. print("\tQuestion what goes woof\t\tdogs\t\t\trabbits") print("\n\nwhat kind of snake is good at maths?\n\nAn adder\n\n") print("\n\nGoodbye\n\n") Escape Sequence Effect \t Explain what \t does here.. \n Explain what \n does here..

11 Activity 5 Print this text, using just one line of code.
Help, I need somebody Help, not just anybody Help, you know, I need someone Place a screenshot of your code here Save the program as oneline.

12 Activity 6 Print this nursery rhyme, using just one line of code.
Three blind mice. Three blind mice. See how they run. See how they run. They all ran after the farmer's wife, Who cut off their tails with a carving knife, Did you ever see such a sight in your life, As three blind mice? Place a screenshot of the console here Save the program as rhyme.

13 Place a screenshot of your code here
Activity 7 Write a program using print commands to display your initials five characters high on the screen. X X X X XX X X X X X X XXXXXX X XX X X Place a screenshot of your code here Save the program as initials.

14 Mathematical Operator (A description of what it does)
Activity 8 Type and run these lines of code. Complete the table to explain what the mathematical operators do. print(60/5) print(987+34) print(564*89) print(2**5) print(43-5) print(11//2) print(11%2) Mathematical Operator Operation (A description of what it does) / + * ** - // % Save the program as operators.

15 Type and run these lines of code.
Activity 9 Type and run these lines of code. print(5 * 3 / 6 + 4) print((5 * 3) / (6 + 4) ) What effect do the brackets have? Save the program as brackets.

16 Type and run these lines of code.
Activity 10 Type and run these lines of code. 15 / 2 * 3 + 2 Predict what you think will happen when the line of code above is executed (run). Save the program as maths. What actually happens?

17 How Can I Improve My Coding Skills?
Codecademy Coding is something you need to practice often to get good at it. Codecademy is a website that allows you to practice the syntax of Python (..and other languages). Best of all, its free and fun! Sign up using a personal address and start working through the Python course. ACTIVITY


Download ppt "GCSE COMPUTER SCIENCE Practical Programming using Python"

Similar presentations


Ads by Google