01 - Introduction To Python - Print Statements Data Types and Calculations
01 - Introduction To Python - Print Statements Data Types and Calculations
Programming
I need to improve my
understanding of this skill.
Data Types
• In programming, there are several different data types which can be used in
different ways.
• Within these initial introduction tasks, the two main data types you will use are
string and integers.
String Integer
Is a data type which represents Is a data type used to
Explanation text. represent whole numbers.
“Hello human, what is your 11, 22, 555, 234, 7654321
Example name?”
• Type the information you want to output within the brackets (parenthesis).
print string:
print integers:
START
OUTPUT: Hello World
END
Task 2: Solution
• Add a print screen to show • Add a print screen to show
your coding here. your output solution here.
Skill 2: Mathematical Operations
• Python allows you to conduct calculations. The following symbols are
used to conduct mathematical operations:
Addition +
Subtraction -
Division /
Multiplication *
We will investigate more uses for these symbols later on
Notes: within the skills development.
Task 3: Rookie
Output the answer to the following sum:
365*12
Flowchart Pseudo code Python
START
OUTPUT: 365*12
END
Task 3: Solution
• Add a print screen to show • Add a print screen to show
your coding here. your output solution here.
Task 4: Rookie
Write the following string statement and integer calculation:
“The answer to the sum 123 x 456 is: ”
123 * 456
Flowchart Pseudo code Python
START
OUTPUT: The
answer to the sum
123 x 456 is:
OUTPUT: 123 * 456
END
Task 4: Solution
• Add a print screen to show • Add a print screen to show
your coding here. your output solution here.
Task 5: Rookie
1. Python also allows you to use some mathematical operators with string
statements.
2. Make the statement “Hello World” repeat 10 times.
Flowchart Pseudo code Python
START
OUTPUT: Hello
World x 10
END
Task 5: Solution
• Add a print screen to show • Add a print screen to show
your coding here. your output solution here.
Skill 3: Using the Comma
• The comma is used to separate character sets, e.g. string and integers.
• Using a comma also creates an automatic space.
Code:
Output:
START
OUTPUT: The
answer to the
sum 123 x 456 is:
(123 x 456)
END
Task 6: Solution
• Add a print screen to show • Add a print screen to show
your coding here. your output solution here.
Task 7: Pro
Write the following using an integer calculation and a comma:
I only have [100-age] years to go until I reach 100!
START
OUTPUT: I only
have [100-age]
years to go until I
reach 100!
END
Task 7: Solution
• Add a print screen to show • Add a print screen to show
your coding here. your output solution here.
Skill 4: Using the \n function
• The newline character is used to split output statements onto separate
lines.
• You add it within string quotation marks.
Code:
Output:
START
OUTPUT: Hello
World
END
Task 8: Solution
• Add a print screen to show • Add a print screen to show
your coding here. your output solution here.
Task 9: Beast
Task: Make the statement “Hello World” repeat 5 times, on
separate lines.
Flowchart Pseudo code Python
START
OUTPUT:
Hello World
Hello World
Hello World
Hello World
Hello World
END
Task 9: Solution
• Add a print screen to show • Add a print screen to show
your coding here. your output solution here.
Programming Challenges
• Now you have learned some programming skills, it’s time to
put them into practice!
• Complete the following programming challenges. Start with
the Rookie challenge and see how far you can push yourself.
• Finally, complete the debugging challenge.
• Once you have finished your challenges, complete the
review. Look back at the skills you have learned so far to help
you solve the challenge.
Add a print screen of
your solutions to the
Programming Challenge: Rookie next slide.
1 Mark
2. Write a calculation which will output the following
number:
1 Mark
Programming Challenge: Rookie 1 - Answer
• Add a print screen to show • Add a print screen to show
your coding here. your output solution here.
Programming Challenge: Rookie 2 - Answer
• Add a print screen to show • Add a print screen to show
your coding here. your output solution here.
Add a print screen of
your solutions to the
Programming Challenge: Pro next slide.
1 Mark
Programming Challenge: Pro - Answer
• Add a print screen to show • Add a print screen to show
your coding here. your output solution here.
Add a print screen of
your solutions to the
Programming Challenge: Beast next slide.
1 Mark
Complete the table below to help you identify what
Challenges Review areas you are confident at and which areas you need
to improve further:
Challenge Your Score (Max 1 mark each)
Rookie Challenge 1
Rookie Challenge 2
Pro Challenge
Beast Challenge
Debugging Challenge
Unit Review
What Went Well: