Hi , welcome in the second lesson of Python tutorial.
In this lesson we'll talk about definition of some frequent programming terms.
These terms are :
A computer
A program
A constant
A variable
Let's begin with the first.
A computer is an electronic machine could perform high-speed mathematical processes in too short time and store data in order to use later by the computer itself or by a user .
A name identifies the constants' or the variables' memory address . This property is crucial for a computer .
A type means what's the kind of data that's stored in a variable or a constant. This property specifies the type of operations that could be applied onto a variable or a constant .
A value is the piece of information that's held by a variable or a constant .
Storage and naming .
In many programming language such as Python, Java, C++ and C we use ""="" to store data into a variable or a constant, but in some like Java, C and C++ you need to declare datas' type
With Python you don't need it -- Python is flexible --
To name a variable or a constant, you should respect these rules:
** it must start with a letter or underscore "_"
** it must not contain any special symbol except underscore
** it must not be a reserved word -- keyword -- in the programming language you use
Advice :
It's better to give a variable or a constant a meaningful name
In this lesson we'll talk about definition of some frequent programming terms.
These terms are :
A computer
A program
A constant
A variable
Let's begin with the first.
A computer is an electronic machine could perform high-speed mathematical processes in too short time and store data in order to use later by the computer itself or by a user .
A program is a set of instructions --commands --that tell the computer what it must do .
A constant is a container holds unchanged data throughout runtime .
A variable is a container holds changeable data .
Note:
A variable or a constant is only a reserved place in the computers' memory
Both a variable and a constant has these three important properties
A name
A type
A value
A name identifies the constants' or the variables' memory address . This property is crucial for a computer .
A type means what's the kind of data that's stored in a variable or a constant. This property specifies the type of operations that could be applied onto a variable or a constant .
A value is the piece of information that's held by a variable or a constant .
Storage and naming .
In many programming language such as Python, Java, C++ and C we use ""="" to store data into a variable or a constant, but in some like Java, C and C++ you need to declare datas' type
With Python you don't need it -- Python is flexible --
To name a variable or a constant, you should respect these rules:
** it must start with a letter or underscore "_"
** it must not contain any special symbol except underscore
** it must not be a reserved word -- keyword -- in the programming language you use
Advice :
It's better to give a variable or a constant a meaningful name
For example : if you want to store your age in a variable that's named "age " ,this is good, but it's better if its name were " myage"or "my_age " .
No comments:
Post a Comment