[ERT ICT Teaching] Learning Python for JSS (08 - Variable Data Type)

preview_player
Показать описание
A complete series of learning python and computational thinking.
Simple enough for junior secondary school students in Hong Kong.
Рекомендации по теме
Комментарии
Автор

Script of this video:

Hi. I'm Mr. Eric Tang. In this lesson, you gonna learn about variable data type,

A variable is a memory location in a computer to store data. In Python, data can be in different types. E.g. a an a floating point a boolean which is just a true false or a text In Python, we don't have any restriction on the data type of any variable, that's mean, we can always assign any type of data to a variable anytime.

Ok.... Lets try together open the Python IDLE and do together.

first, lets type in a=1 it means assigning 1 to the variable a.
now, we try type bracket a, it means we want to know the data type of the data stored in a, and you see the answer is INT, it means integer.

then now we try to assign another data to a. Lets type a=1.12
and type in type(a) again, this time, the answer is "float'.... it means floating point number.

then we assign a equal to a text string 1 (a="1") ... ENTER....
we check the data type again, this time str means "String"

then we assign a=true and check the data type again by inputting this time it shows BOOL means boolean which is just a true false value. Please note that although we type T-R-U-E true here, but the computer will store 1 for true and 0 for false internally.

All right.... here is the summary of today... we can change the data with different data type in a variable anytime. e.g. point number....text string.... or a boolean which means a true false and we can use the command TYPE to check the data type of a variable anytime. Knowing the data type of a variable is very important in programming. We will talk about it in the next video.

See you next time. Bye Bye!

ertxxx
visit shbcf.ru