01-introduction-to-python-print-strings-and-calculations (1).pptx

ict8184 0 views 38 slides Oct 13, 2025
Slide 1
Slide 1 of 38
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38

About This Presentation

python


Slide Content

Introduction to Python Programming Part 1: Data Types, Print Function and Calculations

How to use this resource Within each unit, you will learn how to develop and apply a range of Python programming skills. Skill explanations are in pink . After reading the explanation of a skill, apply it within the given tasks. The tasks are categorised into Rookie (Easy), Pro (Medium) or Beast (Hard). Once you have learned how to apply your new skills, demonstrate your ability by completing the given challenges. Don’t forget the debugging task! Once complete, review your performance! Skill Explanations: Pink Slides Tasks: Rookie Pro Beast Challenges: Rookie Pro Beast

Learning Objectives Rookie To open and save a python program. To write simple print statements. To understand how to print different data types. Pro To combine string and integers within a single print statement. Beast To apply and combine python functions to improve programming efficiency.

Skill Contents Contents Confidence Level Data types (String & Integers) Print function Mathematical operations + - / * Using the comma , Using the newline character \n Once you complete a skill, colour code the box to show your level of confidence. You can always revisit the skill later on to boost your confidence. Key Colour Code I am very good at this skill and could show a friend how to do it. I am confident I can perform this skill on my own. 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 Explanation Is a data type which represents text. Is a data type used to represent whole numbers. Example “Hello human, what is your name?” 11, 22, 555, 234, 7654321 Note : String is always written in “quotation marks”.

Task 1: Understanding String and Integers Within the table below, state if the data shown is a string or an integer : Data Data Type (String or Integer) “I love coding!” 1000000 “1966” “London hosted the 2012 Olympics”

Python Functions A Function is a section of code that performs a specific task. Python has many inbuilt functions which you will begin to learn about as you progress through these introduction activities. As a right of passage, the first piece of code all new programmers need to write the famous computer science phrase “ Hello World ” Within Python, to output a statement you need to use the print function.

Understanding the Python Tasks In order to learn some of the key python functions and programming techniques, you will complete a series of programming tasks split into the levels: Rookie (easiest), Pro (medium) and Beast (hardest). Afterwards, to assess your programming skills, you will complete a series of python challenges to measure your ability: Rookie, Pro or Beast. To help develop your understanding of programming, the solution for each task is presented in both flowchart and pseudo code.

print string: print integers: Notes: String is written within quotation marks. Integers don’t use quotation marks. Skill 1: Using the Print Function The python print function allows you to output information. Y ou write it like this: Type the information you want to output within the brackets (parenthesis).

Task 2: Rookie Flowchart Pseudo code Python START OUTPUT: Hello World END Output the famous programming phrase “ Hello World ”

Task 2: Solution

Addition + Subtraction - Division / Multiplication * Notes: We will investigate more uses for these symbols later on within the skills development. Skill 2: Mathematical Operations Python allows you to conduct calculations. The following symbols are used to conduct mathematical operations:

Task 3: Rookie Flowchart Pseudo code Python START OUTPUT: 365*12 END Output the answer to the following sum: 365*12

Task 3: Solution

Task 4: Rookie Flowchart Pseudo code Python START OUTPUT: The answer to the sum 123 x 456 is: OUTPUT: 123 * 456 END Write the following string statement and integer calculation: “ The answer to the sum 123 x 456 is: ” 123 * 456

Task 4: Solution

Task 5: Rookie Flowchart Pseudo code Python START OUTPUT: Hello World x 10 END Python also allows you to use some mathematical operators with string statements. Make the statement “ Hello World ” repeat 10 times .

Task 5: Solution

Code: Output: Notes: Using a comma allows you to output integers as part of a string sentence. 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.

Task 6: Pro Flowchart Pseudo code Python START OUTPUT: The answer to the sum 123 x 456 is: (123 x 456) END Output the following using an integer calculation and a comma , on the same line : The answer to the sum 123 x 456 is: 56088

Task 6 : Solution

Task 7: Pro Flowchart Pseudo code Python START OUTPUT: I only have [100-age] years to go until I reach 100! END Write the following using an integer calculation and a comma : I only have [100-age] years to go until I reach 100 !

Task 7: Solution

Code: Output: Notes: As you can see, Python identifies the newline character ( \n ) and splits the print output accordingly. 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.

Task 8: Beast Flowchart Pseudo code Python START OUTPUT: Hello World END Task : Write the following using the newline character \n : “ Hello World ”

Task 8 : Solution

Task 9: Beast Flowchart Pseudo code Python START OUTPUT: Hello World Hello World Hello World Hello World Hello World END Task : Make the statement “ Hello World ” repeat 5 times , on separate lines.

Task 9: Solution

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.

Programming Challenge: Rookie Write a piece of code to output the following statement: Write a calculation which will output the following number: Add a print screen of your solutions to the next slide. 1 Mark 1 Mark

Programming Challenge: Rookie 1 - Answer

Programming Challenge: Rookie 2 - Answer

Programming Challenge: Pro Using two integer calculations to output the information indicated below, write a piece of code to output the following statement: Add a print screen of your solutions to the next slide. 1 Mark

Programming Challenge: Pro - Answer

Programming Challenge: Beast Using a suitable integer calculation to output the information indicated below and only one code line, w rite a piece of code to output the following two lined statement: Add a print screen of your solutions to the next slide. 1 Mark Add a calculation to state how many years ago World War 1 ended. ?

Programming Challenge: Beast - Answer

Debugging Question Which of the following lines of code below would output the following statement: Highlight the correct cell in green: 1 Mark

Challenges Review Challenge Your Score (Max 1 mark each) Rookie Challenge 1 Rookie Challenge 2 Pro Challenge Beast Challenge Debugging Challenge Unit Review What Went Well: Even Better If: Complete the table below to help you identify what areas you are confident at and which areas you need to improve further:
Tags