programming for gcse 1 2 writing python scripts n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Programming for GCSE 1.2 Writing Python Scripts PowerPoint Presentation
Download Presentation
Programming for GCSE 1.2 Writing Python Scripts

Loading in 2 Seconds...

play fullscreen
1 / 8

Programming for GCSE 1.2 Writing Python Scripts - PowerPoint PPT Presentation


  • 106 Views
  • Uploaded on

T eaching L ondon C omputing. Programming for GCSE 1.2 Writing Python Scripts. William Marsh School of Electronic Engineering and Computer Science Queen Mary University of London. Aims. Writing Python program Creating files Comments Layout Using ‘print’. Python Program.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Programming for GCSE 1.2 Writing Python Scripts' - penelope-adams


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
programming for gcse 1 2 writing python scripts

TeachingLondon Computing

Programming for GCSE1.2 Writing Python Scripts

William Marsh

School of Electronic Engineering and Computer Science

Queen Mary University of London

slide2
Aims
  • Writing Python program
    • Creating files
    • Comments
    • Layout
  • Using ‘print’
python program
Python Program
  • Python programs can be very simple
    • File (best to name it with extension .py)
  • Much simpler than Java (or C♯)

print(”hello”)

comments
Comments
  • Comment explain a program
  • Comments can be used to help plan a program

# Thisprogram prints a greeting

print(”hello”)

layout
Layout
  • An important feature of Python
  • Indentation matters!

Always start in the same column

the print function
The ‘print’ function
  • The ‘print’ function is used to output a string
  • In these examples
    • The print function has two strings or an expression
      • Note the spaces
    • Both statements output the same thing

print(“hello“, “world“)

print(“hello“ + “ hello“)

printing numbers
Printing Numbers
  • Print can also output a number
  • Example

>>> print("Average is", (30 + 40)/2)

Average is 35.0

summary
Summary
  • A Python program is a file containing statements
    • Simple!
  • ‘print’ for output
    • String and numbers