Introduction to Python
Form 3 - Computer
2023-2024
Floor 4 - Computer Room
Mr. Peter
Outline
Outline
What is Variables?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/9811262/pasted-from-clipboard.png)
1
Variable Demo
2
Variable exercise
3
What is Programming Language?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10129212/pasted-from-clipboard.png)
What is the difference between Python and others programming language?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10129225/pasted-from-clipboard.png)
What is the difference between block-based and text-based?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10129227/pasted-from-clipboard.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10129212/pasted-from-clipboard.png)
VS
What is Variables?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10200394/pasted-from-clipboard.png)
Variable is a box
What is Variables?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10200394/pasted-from-clipboard.png)
This box named "box"
box
What is Variables?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10200394/pasted-from-clipboard.png)
This box can contain Integer
box
999999
What is Variables?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10200394/pasted-from-clipboard.png)
To contain Integer, we can write like this in Python
box
999999
box = 999999
What is Variables?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10200394/pasted-from-clipboard.png)
This box can contain String
box
"Apple"
What is Variables?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10200394/pasted-from-clipboard.png)
To contain String, we can write like this in Python
box
"Apple"
box = "Apple"
What is Variables?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10200394/pasted-from-clipboard.png)
To show what value inside a box (variable), we can use print( ) function
box
"Apple"
print( box )
Apple
Output
Variable Exercise
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10200394/pasted-from-clipboard.png)
num1
10
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10200394/pasted-from-clipboard.png)
num2
40
+
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10200394/pasted-from-clipboard.png)
num3
Store the sum into num3 variable
num1 stores 10 value
num2 stores 40 value
print(
)
Use print( ) function to print the result
F3 - Introduction to Python Lesson01
By Mr Peter
F3 - Introduction to Python Lesson01
- 233