Mapa mental
Computer Science
Contenido del mapa
Computer Science
Python
- Python is simple to learn
- Used By:
- Nokia
- NASA
- Paint Shop Pro
- Google's Search Engine
- Civillisation 4 Computer Game
- CERN Large Hadron Collider Research
- Python's Development Environment
- Called IDLE - Intergrated Development Environment
- Two Modes
- Interactive Mode
- Lets you see your results as you type them
- Script Mode
- Lets you save your program and run it again later
- Interactive Mode
- De-Bugging
- Syntax Errors
- Reading interpreter feedback
- Bugs
- The name "Bug" refers to an error in a program
- Syntax Errors
- Variables
- A variable is a location in memory in which you can temporarily store text or numbers
- You can choose a name for the variable and change its contents for the program
- A variable name can contain only numbers, letters and underscores
- A variable name cannot start with a number
- You can’t use a Python “reserved word” as a variable name – for example class is a reserved word so class = input() will result in a syntax error
- Adding comments
- Comments are useful to help understand your code
- They will not affect the way a program runs
- Comments have a preceding # symbol
- Functions
- Functions are special keywords that do a specific job
- print() and input() are examples of functions
Numbers and Arithmetic
- Data types
- Strings
- Holds alphanumeric data as text
- Interger
- Holds whole numbers
- Float
- Holds numbers with a decimal point
- Boolean
- Holds either True or False
- Strings
- Python automatically assigns a data type to a variable
- You can override this to manually define or change the data type using:
- str()
- int()
- float()
- Assignment statements
- Assignment statements assign a value to a variable. If the variable doesn’t already exist, it’s created.
- Data types
Selection
- Indentation
- Python requires indentation as part of the syntax
- Indentation signifies the start and end of a block of code
- Programs will not run without correct indentation
- Using an IF statement
- An IF Statement uses Selection
- IF forces a decision
- If condition Then do this Else do that
- The ELIF statement
- If gives you two options
- ELIF stands for Else, If and gives you more options
- You can use it as many times as you like
- Indentation
Información
- Descripción
- Mapa Mental sobre Computer Science, creado por Ethan Howes el 31/10/2016.
- Creado por
- Ethan Howes
- Visitas
- 0
- Valoración