1 / 19

Programming

Programming. In. Starter. Using the internet…Find … what does “case sensitive” mean what a programming language is.. 3 benefits of Python. Objectives. Learn about python as a programming language Learn about expressions & variables and their use Create several successful programs

quinto
Download Presentation

Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programming In

  2. Starter Using the internet…Find … what does “case sensitive” mean what a programming language is.. 3 benefits of Python

  3. Objectives • Learn about python as a programming language • Learn about expressions & variables and their use • Create several successful programs Outcomes • All-Level 4- State what a programming language is and what a program is. Get half marks on the test (7/15) • Most-Level 5- Have used variables and with help get 75% on the test (12/15) • Some-Level 6- Written their own programs and independently got maximum marks on the test.

  4. Housekeeping • Open the ICT levels spread sheet and find python tab • Read each Yellow box and answer in the white box.

  5. copy the Unit resources • Copy the folder: Unit 6 Python • From Common K  ICT  Year 8 • To My Documents  ICT  Year 8

  6. Targets. • Open the self evaluation workbook and fill in the boxes in green ellipse (squashed circle) • This workbook will be used throughout the python unit – DO NOT LOSE IT. It will be used at the end by the teacher to assess your ICT Level.

  7. Python • Python is a programming language • A set of words and rules for instructing a computer to perform specific tasks. • The term programming language usually refers to high-level languages, such as BASIC, C, C++, Python etc • Each Programming languagehas a set of keywordsand a special syntax for writing programinstructions.

  8. Learning to program is going to be fun – so lets keep it simple. Why Python org 100h main proc movah,9; movdx,offsethello_message int21h: retn hello_messagedb 'Hello, world!$' main endp end main Assembler python print ("Hello, World!“) #include <iostream> int main() { std::cout << "Hello World!" << std::endl; return 0; } C++

  9. What is a program • Programming is not telling the computer what you want to do….it is telling it EXACTLY HOW to do it. (get student to walk round v robot) • A program is a sequence of instructions that specifies how to perform a computation. • The computation might be something mathematical, such as solving a system of equations • It can also be a symbolic computation, such as searching and replacing text in a document or moving a graphic icon (sprite) on a game.

  10. TRadition • It is tradition that the first program everyone creates is to say Hello world”. • From the start menu – all programs / python 3.3 / idle • Open Idle(python GUI) • MAKE SURE YOU ARE IN THE PYTHON SHELL • Enter the following and press enter print (“Hello, World”) If you see this window on top – look for the python shell window. This one

  11. Expressions Try typing some of these expression in idle, pressing return after each one print (2+2+2+2+2) print (8*6) print (10-5+6) print ( 2  +       2)

  12. Expressions You have been using expressions 2 values and an operator Even the 2+2+2+2 follows this rule Operators, you already know. Perhaps the multiplication is written differently as a * (on the number pad) At the moment python is acting like a calculator.

  13. Syntax In computer science, the syntax of a programming language is the set of rules that define the combinations of symbols that are considered to be correctly structured programs in that language. Aka syntax means that special key words and characters combine to result in a program.

  14. Syntax • Syntax is CRITICAL in programming. A computer cannot take an educated guess at your instructions. • Computers just follow exactly what you tell them to do. • The syntax of a programming language is the set of rules that control if a program is correct. • You tried print (“Hello, World”) and it worked – a correct program. • Try these print hello print (hello) PRINT(“hello”) print (a + b) print (5 + 6 / 7 +)

  15. Variables A variable is just a box with a number in it. When we use variable in our code the computer uses the value in the variable. To store the value 15 in the variable and display it spam = 15 print (spam) Try it. Now try these spam = spam + 12 print (spam) spam = spam + spam print (spam) spam = spam * spam print (spam)

  16. Variables This time we have 2 variables eggs and fizz You can assign them by eggs = 15 fizz = 10 What be the output of the following, go on try it. print( eggs ) print( eggs + fizz ) spam = eggs + fizz print( spam ) eggs = fizz print( eggs ) print( EGGS ) In python eggs is not the same as EGGS. Python is case sensitive which means YOU MUST BE CAREFUL 15 25 >>>nothing 25 >>>nothing 10 Traceback(most recent call last): File "<pyshell#37>", line 1, in <module> EGGS NameError: name 'EGGS' is not defined

  17. Complete Self Assessment quiz Complete Self Assessment quiz from lesson 1 folder you copied at the start of the lesson.

  18. Plenary Mark the self assessment And update your self-evaluation for this lesson.

  19. Fun time Try the space ship challenge tdemo_spaceship in common K/ temp_store.

More Related