Introduction and Variables and Data Types Flashcards
What is the difference between compiled and interpreted languages?
Compiled Languages
1. Code is sent to compiler
2. Compiler translates entire program into code compatible with with target or host machine (Machine Code)
3. Target executes code and return output
Interpreted languages
1. Code read by an interpreter
2. Interpreter returns output without creating executable machine code as independent artifact
What is JupyterLab?
- Integrated development environment
- Facilitates robust development of large Python projects
What is Anaconda?
- Popular distribution packet of Python
- Machine learning and Data sciene
How to access help on functions? Give example with the print function.
help(print())
How do you start interpreter?
Typing:
python
in the interpreter
Explain what a interpreter is
- Program that reads and executes Python code
- Parsing, compiling, and interpreting
Which naming rules exist for variables in python?
Do´s
* Start with letter or underscore
Dont´s
* Existing Variable names
* Reserved words (print, def)
What is wrong $weight = 73
? And which Error would Occur?
- Invalid Syntax error
- Must start with underscore or letter
Which python style naming conventions are there for naming variables?
- All lowercase
- Words separated by underscores
What is the assignment operator and how does he works?
- (=) sign is called an assignment operator
- Assigns value from right-to-left.
What are literals?
- Numbers
- Have the value that they literally and explicitly should have (in this case, 73)
- Cannot be redefined with a different value
How would you scientificaly notate
4.5 x 10^7 ? Explain syientific notation and give an example.
- Represent very large or small numbers
- Commonly used in scientific and engineering fields
4.5e7
How are imaginary numbers represented in Python?
- Build in data type:
~~~
complex
~~~
```
complex_number = 1+6J
~~~
Write down a hexadecimal
0xFF
- 0x followed by hex part
Write down an Octal
0o23
* Zero followed by lower case o