Mindmap
Programming
Inhalt der Mindmap
Programming
Data
- Data is unprocessed
- There can be different types of data like strings, characters and floats (decimals)
- Data type: how data is stored
- Structure of data: how data is presented
Information
- Information is processed data
- Formula for information: date + structure + context + meaning
Constants
- Temporary memory location
- as well as variables, you can define constants in a program
- typically shown in uppercase
- Constants are not expected to change. It is possible to change a constant by assigning a new value to it.
Variable
- A variable is a memory location that can store data that can change, to be used in a program.
- Rules for Python variables
- a variable name must start with a letter or an underscore
- cannot start with a number
- they are case sensitive
- a variable name can only contain alpha-numeric characters and underscores (a-z, 0-9, _)
- Declaring a variable
- giving it a name and a type (string/int/char/float) In python a type is not needed.
- Initializing a variable
- giving it a value
Arithmetic operators
- + , - , * , / for addition, subtraction, multiplication and division
- Exponent - ^ (to the power of)
- The operator DIV is used for integer division (get rid of the decimal)
- E.g. 17 DIV 3 = 5
- MOD (modulus) is used to find the remainder when dividing one integer by another
- E.g. 17 MOD 3 = 2
- Remember to use BODMAS!
Inputting numeric variables
- In Python, all input is accepted as a string
- tickets = input("Please enter number of tickets." tickets = int(tickets)
- tickets = int(input("Please enter number of tickets"
- In Python, all input is accepted as a string
String handling functions
- when using POSITION, start from 0
- when using len (length), start from 1
ASCII
Bilder und Dateien der Mindmap
Informationen
- Beschreibung
- Mindmap am Programming, erstellt von Hibba Tariq am 19/11/2019.
- Erstellt von
- Hibba Tariq
- Aufrufe
- 1
- Bewertung