Beginner's Guide to Python
Beginner's Guide to Python
Open with Python as a beginner-friendly programming language used to write instructions for computers. Keep the focus on what students need before their first practical lesson.
Learning goal
I can explain the main ideas of Python basics, including input, output, variables, data types, casting, string concatenation, and simple IF/ELSE decisions.
Deze slide heeft geen instructies
What words come to mind when you hear Python?
Use this to surface prior ideas such as coding, computers, games, commands, hard, easy, robots or apps. Pick out any misconceptions to revisit later.
What is Python?
Python is a programming language
It lets us write instructions for a computer
It is popular because the code is clear and easy to read
Beginners often start with Python because it uses simple syntax
Deze slide heeft geen instructies
Why do we use Python?
Python can be used to make many kinds of programs.
simple calculators
games
data projects
websites
automated tasks
One language can solve many different problems, which makes it useful to learn.
You can mention that students will begin with small text-based programs before moving to larger tasks.
Python code is made of commands
A Python program is a set of commands written in order.
Each command tells the computer what to do, such as:
show text on the screen
ask the user for information
store a value
make a choice
This slide links the introduction to the practical features in the next subtopics.
What does Python let us write for a computer?
Pictures
Instructions
Passwords
Folders
Checks the core idea from slides 2 to 4: Python is a programming language used to write instructions, not just to make one type of file or product.
Complete the summary
Python is a programming language used to write instructions for a computer. A program is made of commands written in order, and one language can solve many different problems.
Echoes the wording from the introduction slides and focuses on the load-bearing terms students need before the practical work starts.
Output with print()
`print()` is used to display output on the screen.
Example:
`print("Hello")`
The text inside the brackets is shown to the user.
Emphasise that output means information sent from the program to the screen.
Input with input()
`input()` is used to ask the user for information.
Example:
`name = input("What is your name? ")`
The program waits for the user to type an answer.
Point out that input from the keyboard is stored so the program can use it later.
What is a variable?
A variable stores data in memory so the program can use it later.
Example:
`name = "Aisha"`
Here, `name` is the variable and `"Aisha"` is the value stored in it.
A helpful analogy is a labelled box: the label is the variable name, and the content inside is the stored value.
String or variable name?
A raw string is written inside quotation marks.
`"Hello"` is text
`name` is a variable name
`print("name")` shows the word name
`print(name)` shows the value stored in name
Use this slide to tackle a common misconception: quotation marks mean the computer treats the content as text, not as a variable.
What does print() do?
Stores data
Shows output
Checks a condition
Asks for input
Tests the difference between output, input, variables and decisions from slides 5 to 8.
Complete the Python idea
In Python, print() shows text on the screen and input() asks the user for information. A variable stores a value, while a raw string is written inside quotation marks.
Targets the common misconception from slide 8: text in quotation marks is treated as a string, not a variable name.
Joining text together
String concatenation means joining strings together.
Example:
`print("Hello " + "Sam")`
This produces one longer piece of text.
Deze slide heeft geen instructies
Text and variables in print()
We can join a string and a variable with `+`.
Example:
`name = "Sam"`
`print("Hello " + name)`
The output becomes:
`Hello Sam`
Stress that the variable is not in quotation marks when we want Python to use its stored value.
Why concatenation matters
Concatenation helps create messages that change.
Instead of showing the same fixed text every time, a program can use stored data.
This makes output more personal and more useful for the user.
You can link back to input: the user types a name, the name is stored in a variable, then concatenation displays it in a sentence.
Which code would print Hello Sam?
print(name + Hello)
print("Hello" + "name")
print("Hello " + name)
print("name" + "Hello")
The distractors reflect likely errors: missing quotation marks around text, putting quotation marks around the variable name, or reversing the intended message.
Why is concatenation useful?
Changes messages
Makes code shorter
Stores numbers
Tests conditions
Deze slide heeft geen instructies
Main data types
Python stores different kinds of data in different ways.
String: text, such as `"hello"`
Integer: whole number, such as `7`
Float: decimal number, such as `3.5`
The data type affects what the program can do with the value.
Deze slide heeft geen instructies
Why type matters
The computer needs to know whether a value is text or a number.
strings are used for words and messages
integers and floats are used for calculations
`"5"` and `5` may look similar, but Python treats them differently.
A useful example: adding 5 and 5 gives 10, but joining "5" and "5" gives "55".
Changing a data type
Casting means changing one data type into another.
Example:
`age = input("Enter age: ")`
`age = int(age)`
`input()` gives text, so we use `int()` if we want to do maths with the value.
This is a key beginner point: input values arrive as strings unless they are cast.
Casting in a calculation
Example:
`number = input("Enter a number: ")`
`total = int(number) + 5`
`print(total)`
If the cast is correct, Python can add the number and show the result.
You may mention that floats can be made with `float()` when decimals are needed.
Why might we use int() after input()?
To join text
To do maths
To print output
To name a variable
Checks the key beginner point from slides 12 to 15: input() gives text, so casting is needed before calculation.
Complete the data type summary
A string is text, an integer is a whole number, and a float is a decimal number. We use casting to change a value into a new type when needed.
Keeps the focus on the three main types taught on the slides and the purpose of casting.
How programs make decisions
Programs do not always follow one fixed path.
They can check a condition and choose what to do next.
This is how a program makes a decision.
Bridge from data to logic: once a program has values, it can compare them and respond.
Using IF and ELSE
`if` runs code when a condition is true.
`else` runs code when the condition is false.
Example:
`if score >= 50:`
` print("Pass")`
`else:`
` print("Try again")`
If helpful, briefly explain that the colon and indentation are part of Python syntax.
Conditions compare values
A condition checks whether something is true or false.
Common comparisons include:
`==` equal to
`>` greater than
`<` less than
`>=` greater than or equal to
Avoid overloading with too many operators; keep to the basic ones named on the slide.
Decision making in context
A simple Python program often follows this pattern:
input → store in variable → cast if needed → check with `if`/`else` → print output
These parts work together to make the program respond to the user.
This slide resolves the lesson arc by linking all earlier subtopics into one simple program flow.
When does else run in Python?
When input is text
When the condition is false
When the condition is true
When output is printed
Checks the basic if/else rule from slides 16 to 19.
Complete the program flow
A simple Python program can take input, store it in a variable, cast it if needed, then use if and else to choose the output.
This mirrors slide 19, which brings the whole lesson together into one sequence.
How does a condition help a program choose?
Expected elements: a condition checks if something is true or false, and the program uses that result to choose what to do next, for example with if/else.
What is one thing you learned about Python today?
Reflection only. Invite brief answers about key ideas such as variables, casting, concatenation or if/else.
What helped you understand this lesson best?
Reflection only. Students may mention examples, step-by-step flow, or seeing code and output together.
Which part of Python still feels hardest?
Reflection only. Likely answers include quotation marks vs variables, data types, casting, or conditions.
Glossary
Python - a programming language used to write instructions for a computer
print() - a command that shows output on the screen
input() - a command that asks the user to enter data
variable - a named place that stores a value
string - text data written inside quotation marks
integer - a whole number data type
float - a decimal number data type
Deze slide heeft geen instructies
Glossary
concatenation - joining strings or text values together
data type - the kind of data a value is, such as string, integer, or float
casting - changing a value from one data type to another
if - a command that runs code when a condition is true
else - a command that runs code when a condition is false
condition - a test that checks whether something is true or false
Deze slide heeft geen instructies