Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

Programming Constructs Python-Students

The document introduces the three main programming constructs: Sequence, Selection, and Iteration, and explains their significance in programming. It also discusses the use of flowcharts in program design to visualize these constructs. Additionally, it includes student challenges to reinforce understanding of these concepts using Python programming examples.

Uploaded by

megan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Programming Constructs Python-Students

The document introduces the three main programming constructs: Sequence, Selection, and Iteration, and explains their significance in programming. It also discusses the use of flowcharts in program design to visualize these constructs. Additionally, it includes student challenges to reinforce understanding of these concepts using Python programming examples.

Uploaded by

megan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Programming Constructs

An Introduction with
Python
Programming Constructs
“There are 3 different
constructs used in
computer programming.”

 Sequence – A series of ordered


processes.
 Selection – A decision, which is
based on whether a certain condition
is met.
Programming Constructs - Flowcharts
Flowcharts are often used in program design to aid
understanding.
Sequence Selection Iteration / Loop

Flowcharts are used often in program design


but they are not the only method. Another
Student Challenge #1
Complete the gaps, and place the activity (boxes) in the correct location.
S_ _ _ _ _ _ _ S_ _ _ _ _ _ _ _ I_ _ _ _ _ _ _ _ / L_ _ _

Go to the
Put on coat
cinema

Stay at home
Add water and watch TV

Is
Have
Check contents the cup at least
Of wallet/purse
full?
Put on jumper
Stop Put on shirt
£10?
Flowchart Symbols

Arrow Connects the different


symbols and shows the
Student Challenge #2
Drag text to each symbol to complete the flowchart. The first one’s done for you.

Start


… …




Look at the following snippets of
Python…
Are they a sequence, a selection or an
iteration?
?
Sequence

?
Selection

?
Iteration
Student Challenge #3
Are they a sequence, a selection or an
iteration?
???????

???????

???????
Programming Introduction - Recap
What are the 3 constructs used in computer programming?

? ?

?
Now attempt the Sequencing, Selection and Iteration Quiz
(Press Shift + F5 to run this slide, and then click the above link)
Python Challenge
If you already have some Python programming experience, try this challenge.
Here is the familiar ‘Hello World’ program. Cut & paste it to your IDLE editor.

print ("What is your name?")


firstname = input()
print ("Hello ",firstname)

print ("\nWhere are you from?")


print ("1. England")
print ("2. France")
print ("\nSelect: 1 - 5:")

language = input()

if language == "1":
print ("Hello World!")

Add to it so it will output ‘Hello World’ in one of 5 different languages,


depending on which language you speak. You may choose your own languages!
(Hint: Google Translate may well come in handy!)

You might also like