History of Python and general maths operations Flashcards
What is a script?
A program that uses an interpreter to execute its instructions, interpreted instructions execute slower because one script instruction can take multiple interpreter instructions
What is an interpreter?
A program that reads and executes the instructions from a script
What language did python derive from?
ABC,
- Pythons name came from a TV show:
Monty Python
Is python open source?
Yes so people can make new interpreters
Who created Python and when?
Guido van Rossum in the late 1980s:
Python was first released in 1994
What is machine code?
The most basic code for a device, binary
- strings of binary create instructions and these instructions create an executable program
What is an assembler?
A program that translates human readable code from an ‘assembly language’ into machine code so it can be executed by the program
- benefits of an assembler allowed us to interpret what we were coding and make more complex programs
What are high-level languages?
Similar to assembly languages but on a more extreme scale, they allow us to use formulas and algorithms to write complex code
What is a compiler?
Translates high-level language into low-level machine instructions
What is RAM?
Volatile storage with faster access usually located off the processor chip
What is an operating system?
Manages programs and interfaces with peripherals
What is Moore’s law?
The doubling of integrated circuits (IC) transistor capacity roughly every 18months
What is cache?
Relatively small, volatile storage located on the processor
What is a disk/HDD/SSD?
Non-volatile storage with slower access
What is a clock?
Hardware that measures the speed at which a processor executes instructions
What is an interactive interpreter?
A program that allows the user to execute the code line by line
What is a statment?
A program instruction, usually appears on one line
What are expressions?
Code that returns a value when executed
What is used to develop code?
Integrated Development Environment (IDE)
- Python uses IDLE which provides a basic environment for editing and running programs
What is the function of x / y (division)?
Divides x by y
- results in a float
what is the function of x // y?
Floor division, rounds down the division of x and y to the nearest whole number
- results in a integer
What is the function of x % y?
Modular division, finds the remainder of x / y
- results in an int
What is the function of celi(x)?
ceiling function, round up x
- results int
What is the function factorial(x)?
The factorial of x…
- results int
What is the function of fmod(x,y)?
Remainder of x / y,
- same as % function
- results float
What is the function of exp(x)?
e^x
- results float
What is the function of pow(x,y)?
x^y
- results in float
What is the function of fabs(x) and abs(x)?
absolute value of x
- fabs() results in a float at all times
- abs() results in an int unless necessay
What is the function of floor(x)?
Rounds down x to nearest int
- results in int
What is the function of sqrt(x)?
Positive square root of x
- results in float
What is the function of:
acos(x)
asin(x)
atan(x)
cos(x)
sin(x)
tan(x)
As written
- results in float
What is the function of hypot(s1,s2, …sn)
The length of a vector from the origin using multiple existing vector inputs,
- can also be used to find the hypotenuse of a triangle after inputting two vectors/side
- results in float
What is the function of radians(x) and degrees(x)
Converts to radians or degrees
- results in float
What is the order of operations?
Parentheses
Indices
Positive and negative argument
* / // % (first come first serve)
+ -
< > >= <= != == (first come first serve)
Not
And
Or