0% found this document useful (0 votes)
7 views14 pages

01 Input and Output

Uploaded by

pchambers
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)
7 views14 pages

01 Input and Output

Uploaded by

pchambers
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/ 14

Input and Output

Computer Science

© Nichola Wilkin Ltd 2019


www.nicholawilkin.com
1
Starter
Work in pairs to explain what this
program does:

© Nichola Wilkin Ltd 2019


www.nicholawilkin.com
2
Lesson Objectives
All of you will…
▪Use basic input and print statements
Most of you will…
▪Define a variable and know the rules for
naming variables
Some of you will…
▪Combine strings with variables in the print
statement
© Nichola Wilkin Ltd 2019
www.nicholawilkin.com
3
© Nichola Wilkin Ltd 2019
www.nicholawilkin.com
4
Type these into the Python
shell to find the answers
• 58+34 = 92
• 72-58 = 14
• 17*6 = 102
• 384/24= 16
• 155//8 = 19
• 155%8 = 3

© Nichola Wilkin Ltd 2019


www.nicholawilkin.com
5
© Nichola Wilkin Ltd 2019
www.nicholawilkin.com
6
Over to you…
• At the prompt ask for an animal.
• Input an animal.
• Display an output that says My friend owns a
[animal]
• At the prompt ask for a food.
• Input a food.
• Display an output that says I hate [food] on a pizza
• Display an output that says My friend’s [animal]
likes to eat [food]
© Nichola Wilkin Ltd 2019
www.nicholawilkin.com
7
Pop Quiz
1. Which symbol is used for a whole number
division?
2. Which symbol is used to find the
remainder after a whole number division?
3. What word is used to ask the user to
enter a value?
4. What word is used to display an output?
5. How to you separate the sections in a
print statement ?
© Nichola Wilkin Ltd 2019
www.nicholawilkin.com
8
© Nichola Wilkin Ltd 2019
www.nicholawilkin.com
9
What of these are valid
variable names?
• student name

• x*y

• num2

• total!

• 45class

• [number]

© Nichola Wilkin Ltd 2019
www.nicholawilkin.com
10
Pop Quiz
1. What is a variable?

2. What is a string?

3. What is an integer?

4. What is a floating-point number?

© Nichola Wilkin Ltd 2019


www.nicholawilkin.com
11
© Nichola Wilkin Ltd 2019
www.nicholawilkin.com
12
How much do
you remember?

Create these
programs to
recap what
you have
learnt.

© Nichola Wilkin Ltd 2019


www.nicholawilkin.com
13
Plenary
Tell the teacher what to type in:
You need tell your teacher how to create a
program that will ask the user to enter a
number of days (i.e. 7) and it should tell the
user the number of hours, minutes and
seconds that are in that number of days (i.e. 7
days contains 168 hours, 10080 minutes and
604800 seconds).
© Nichola Wilkin Ltd 2019
www.nicholawilkin.com
14

You might also like