17/01/2024 - Recap Flashcards
how do you create a list
list = []
what can a list contain?
mixed types
How do you index and slice lists?
The same a strings
Are lists mutable or immutable?
Lists are mutable
Get the largest or smallest of two values
max(va1, val2) or min(val1, val2)
Decimal part of a division
Modulus operator ‘%’ 1 % 2
whole number part of a division
math floor operator math.floor(1/2) or 1//2
What is black
A python formatter. Formats files in place
What is poetry
A tool for dependency management and packaging
What is poe
A task runner for poetry.
What is jinga
A web template engine. Similar to django
What is linting and name a linting tool
Flake8 is a linting tool. It checks your code base for errors, styling issues and complexity
What is pep?
Python enhancement proposals
What is pep8?
Pep8 is a style guide for python code
What pytest?
A python testing framework
What are the advantanges of python?
Easy to read and learn
Reduces maintenance costs
Easy Memory Management
Wide applicability
Large community
Easy integration with other programming languages
Asynchronous coding
Portable
Enterprise Application Integration
What are the disadvantages of python?
Slow execution speed
Large memory consumption
Not ideal for mobile and game development
Addiction to easy coding
Weak database access
Design restrictions
More prone to runtime errors
what type of language is python?
A dynamically typed language. Type-checking is performed at runtime. It’s also an interpreted language, which run slower than compiled code.
What are python collections?
What are iterators?
What are list comprehension s?
What is the name of the OOD principles?
SOLID
What are the solid principles?
Single responsibility
Open-closed
Liskov Substitution
interface segregation
Dependency inversion
What is dynamically typedvs statically typed?