Introduction to Python

Form 3 - Computer

2023-2024

Floor 4 - Computer Room

Mr. Peter

Outline

Outline

What is Variables?

1

Variable Demo

2

Variable exercise

3

What is Programming  Language?

What is the difference between Python and others programming language?

What is the difference between block-based and text-based? ​

VS

What is Variables?

Variable is a box

What is Variables?

This box named "box"

box

What is Variables?

This box can contain Integer

box

999999

What is Variables?

To contain Integer, we can write like this in Python

box

999999

box = 999999

What is Variables?

This box can contain String

box

"Apple"

What is Variables?

To contain String, we can write like this in Python

box

"Apple"

box = "Apple"

What is Variables?

To show what value inside a box (variable), we can use print( ) function

box

"Apple"

print( box )

Apple

Output

Variable Exercise

num1

10

num2

40

+

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