Skip to content

Commit f16e01c

Browse files
committed
feat(fcs): add python knowledge fcs
1 parent 5ab7b37 commit f16e01c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

flashcards/python-knowledge.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
What does 'first class object' mean?;
2+
3+
egs of first-class objects in Python; Functions, classes.
4+
5+
Is Python interpreted or compiled?; interpreted.
6+
7+
typing of Python; dynamically typed (vs statically typed, specify types)
8+
9+
does Python have access specifiers?; No. (e.g. C++'s public, private. bc 'we are all adults here'.)
10+
11+
compiled vs interpreted languages; - compiled: (compiled code) can be executed directly in the CPU's 'native' language. - interpreted: must be translated at runtime from original format to CPU machine instructions
12+
13+
Deep vs shallow copy; -Shallow copy copies reference pointers and changes to copied will change original. Faster. - Deep copy copies values but not reference pointers, is slower.
14+
15+
Deep copy; Stores values copied separately. - Doesn't copy reference pointers. - Changes made in copy won't affect original etc. - Slower than shallow copy.
16+
17+
Shallow copy; Copies reference pointers just like it copies values. - Changes made will also affect the original. - faster execution that depends on data size(?)
18+
19+
lists vs tuples; lists are mutable, tuples are not.
20+
21+
How multithreading is done in Python; - Global Interpreter Lock (GIL): makes sure only one thread executes at a time. Thread acquires GIL, does some work, then passes GIL onto next thread. - i.e. take turns using same CPU core. - GIL passing adds overhead to execution (slower)
22+
23+
example of ternary operator; 5 if x > 4 else 4
24+
25+
Memory management in Python;
26+
27+
Sources:
28+
- https://www.edureka.co/blog/interview-questions/python-interview-questions/

0 commit comments

Comments
 (0)