Mind map
PROGRAMMING TECHNIQUES
Map content
PROGRAMMING TECHNIQUES
Programming fundamentals
- Variables and constants
- Variables are named locations in memory that are used to store temporary values that can change as the program is run
- Constants are named locations in memory that are used to store values that do not change throughout the program's execution
- The value stored by variable or constant can be set or recalled by using the identifier (name) of the variable
- The process of setting a value to a variable or constant is called assignment
- Variable declaration
- In some programming languages, variables need to be declared before they can be used to store data.
- Declaring a variable means to state its name (identifier) and the type of data that it will contain
- Python doesn't require that variables are explicitly declared before they are used. Instead, they are automatically declared upon first use. Python also doesn't require that the type of data being stored is stated, it simply infers the data's type from the data that is assigned to (stored in) the variable.
- Choosing a suitable identifier
- It is important that variable identifiers (names) are clearly descriptive of the data that they hold.
- Using sensible, clear and descriptive variable identifiers helps to ensure that code is easily understood by yourself and other developers and will reduce the need for documentation and the likelihood of making errors. If errors do appear, the code will be easier to understand and therefore the source of errors will be easier to identify and fix.
- Rules for choosing good identifiers
- Identifiers can cannot include spaces
- Identifiers can contain letters, numbers and underscore symbols (_) only
- Certain reserved words cannot be used as identifiers if they are existing built-in commands,
- Identifiers are case sensitive.
- Identifiers should be short
- Assignment
- Using a variable's value
- Assigning a new value to a variable
- Constants
- Inputs and outputs in Python
- Outputting special characters
- Numerical inputs
- Numerical inputs
- Comments
- Variables and constants
Information
- Description
- Mind Map on PROGRAMMING TECHNIQUES, created by Benjamin DeJong on 26/02/2019.
- Created by
- Benjamin DeJong
- Views
- 0
- Rating