Title: getters and setters in Python
Getters and Setters are used to ensure data encapsulation in OOP.
In python they are not the same as in other languages, because private variables are not hidden in python.
Getters and Setters are used to add validation for getting and setting values or to avoid direct access of a class field.
π get() and set() methods don't fully work as getters and setters. In this case, python has a special function property()
Sources: Python cookbook and geeksforgeeks
Getters and Setters are used to ensure data encapsulation in OOP.
In python they are not the same as in other languages, because private variables are not hidden in python.
Getters and Setters are used to add validation for getting and setting values or to avoid direct access of a class field.
π get() and set() methods don't fully work as getters and setters. In this case, python has a special function property()
Sources: Python cookbook and geeksforgeeks
#memory_management
Title: Integer Caching in Python
The Python implementation front loads an array of integers between -5 to 256. Hence, variables referring to an integer within the range would be pointing to the same object that already exists in memory
Source
Title: Integer Caching in Python
The Python implementation front loads an array of integers between -5 to 256. Hence, variables referring to an integer within the range would be pointing to the same object that already exists in memory
Source
Assalomu alaykum
leetcode.com yoki binarysearch.com da masala ishlab yuradiganlar bo'lsa,
@dilshodbek_xojametov DIlshodbek botga ulangan gruppa yaratganlar, qiziquvchilar bo'lsa lichkalariga o'zingizni leetcode dagi yoki binarysearch.com dagi usernamizni jo'natsangiz gruppaga qo'shib qo'yishadi.
Guruh qoidasi:
- Har kuni kamida 1 ta misol yechish
- 2 kun ichida bitta ham misol yechmasa guruhdan kick bo'ladi
Guruhdan maqsad masala yechishni eslatib turish va ko'proq masala ishlashga qiziqtirish. O'zingizni reytingizni kuzatib yursangiz ham bo'ladi.
βοΈRECOMMENDED
leetcode.com yoki binarysearch.com da masala ishlab yuradiganlar bo'lsa,
@dilshodbek_xojametov DIlshodbek botga ulangan gruppa yaratganlar, qiziquvchilar bo'lsa lichkalariga o'zingizni leetcode dagi yoki binarysearch.com dagi usernamizni jo'natsangiz gruppaga qo'shib qo'yishadi.
Guruh qoidasi:
- Har kuni kamida 1 ta misol yechish
- 2 kun ichida bitta ham misol yechmasa guruhdan kick bo'ladi
Guruhdan maqsad masala yechishni eslatib turish va ko'proq masala ishlashga qiziqtirish. O'zingizni reytingizni kuzatib yursangiz ham bo'ladi.
βοΈRECOMMENDED
Forwarded from Azim Pulat
Assalomu alaykum!
Oxirgi kunlarda juda ko'p so'ralgan savol bo'lgani uchun o'zimni intervyular haqida hozirgacha bo'lgan fikrlarimni va birozgina olgan tajribamni sizlar bilan ulashmoqchiman π
Demak boshladik β³
Mavzu: Texnik intervyularda Python dasturlash tilida backend dasturchilaridan so'rashlari mumkin bo'lgan mavzular to'plami yoki o'rganishimiz kerak bo'lgan mavzular to'plami desak ham to'g'riroq bo'ladi.
>> Data types in python
-difference between list and tuple etc;
-difference between mutable and immutable data types and how they are saved in the memory;
- sorting list/tuple/dictionaries;
>> id() function
>> Decorators
>> Iterators with Generators
-- difference between iterators and iterables
>> Python classes(self in class methods)
>> Context managers in Python
>> Threads/Processes/GIL
>> Garbage collectors
>> Memory management in Python
>> Reference counting in python
>> Questions related to Testing
β PROBLEM SOLVING
Qo'shimcha mavzular:
-- Big O notation
-- OOP/SOLID principles
-- CI/CD
-- Docker (images, containers)
-- Methodologies (Agile, Scrum)
--Database related questions:
> Relational database with non-relational databses
> Indexing
> queries with JOIN
β agar ishlatgan bo'lsangiz python frameworklari (django, FastAPi, Flask) va ularning ORMiga oid savollar ham bo'lishi mumkin.
va boshqalar )
π Shu yerda tavsiya: bu mavzularni faqat intervyu uchun o'rganmang, juda tez vaqt ichida yodingizdan ko'tarilib ketishi mumkin, aksincha real proyektlarda qo'llashga yoki kimgadur tushuntirib berishga harakat qiling shunda yodingizda ko'proq qoladi.
ππ Qo'shimcha tavsiya )
Bu mavzularni o'zini alohida izlab o'rgangandan ko'ra kitoblardan o'rganganimiz ancha foydaliroq va o'zimiz kutgandan ham ko'proq narsa olishimiz mumkin.
Hozircha men tavsiya qila oladigan resurslar:
Python_101 (by Michael Driscoll)
Python Coockbook (by David Beazley and Brian K. Jones)
Python tricks (Dan Badar)
Python basics: https://stepik.org/course/512/syllabus
Learning Python: Powerful Object-Oriented Programming
---------------------------------------------------------
Intervyular juda foydali deb o'ylayman, ayniqsa dasturchilar uchun. Sizni o'z sohangizda o'sishingizga yordam beradi va qayerlarda kamchiligingiz bor va nimalarni mustahkamlashingiz kerakligini yaqqol ko'rsatib beradi (xuddi peshonangizni devorga urgandek π ).
Intervyularda olgan natijani to'g'ri qabul qiling, o'zingizga bo'lgan ishonchni so'ndirishiga qo'ymang yoki juda oson o'tgan bo'lsa o'zingizga ortiqcha baho berib miyangizni tormozlab qo'ymang.
Intervyulardan yiqilish yaxshiπ, Chunki keyingilarida yiqilishdan qo'rqmaysiz uje yiqilib ko'rgan bo'lasiz va yanayam yaxshiroq o'rganishingizga turtki bo'ladi.
Haqiqiy intervyudan oldin, do'stlaringizdan yoki tajribasi sizdan ko'proq insonlardan mock intervyular olib ko'rishlarini iltimos qiling, juda kotta yordam beradi bu ham. Hamda bitta joyga emas bir nechta joylarga apply qilib ko'rish kerak.
Oxirgi kunlarda juda ko'p so'ralgan savol bo'lgani uchun o'zimni intervyular haqida hozirgacha bo'lgan fikrlarimni va birozgina olgan tajribamni sizlar bilan ulashmoqchiman π
Demak boshladik β³
Mavzu: Texnik intervyularda Python dasturlash tilida backend dasturchilaridan so'rashlari mumkin bo'lgan mavzular to'plami yoki o'rganishimiz kerak bo'lgan mavzular to'plami desak ham to'g'riroq bo'ladi.
>> Data types in python
-difference between list and tuple etc;
-difference between mutable and immutable data types and how they are saved in the memory;
- sorting list/tuple/dictionaries;
>> id() function
>> Decorators
>> Iterators with Generators
-- difference between iterators and iterables
>> Python classes(self in class methods)
>> Context managers in Python
>> Threads/Processes/GIL
>> Garbage collectors
>> Memory management in Python
>> Reference counting in python
>> Questions related to Testing
β PROBLEM SOLVING
Qo'shimcha mavzular:
-- Big O notation
-- OOP/SOLID principles
-- CI/CD
-- Docker (images, containers)
-- Methodologies (Agile, Scrum)
--Database related questions:
> Relational database with non-relational databses
> Indexing
> queries with JOIN
β agar ishlatgan bo'lsangiz python frameworklari (django, FastAPi, Flask) va ularning ORMiga oid savollar ham bo'lishi mumkin.
va boshqalar )
π Shu yerda tavsiya: bu mavzularni faqat intervyu uchun o'rganmang, juda tez vaqt ichida yodingizdan ko'tarilib ketishi mumkin, aksincha real proyektlarda qo'llashga yoki kimgadur tushuntirib berishga harakat qiling shunda yodingizda ko'proq qoladi.
ππ Qo'shimcha tavsiya )
Bu mavzularni o'zini alohida izlab o'rgangandan ko'ra kitoblardan o'rganganimiz ancha foydaliroq va o'zimiz kutgandan ham ko'proq narsa olishimiz mumkin.
Hozircha men tavsiya qila oladigan resurslar:
Python_101 (by Michael Driscoll)
Python Coockbook (by David Beazley and Brian K. Jones)
Python tricks (Dan Badar)
Python basics: https://stepik.org/course/512/syllabus
Learning Python: Powerful Object-Oriented Programming
---------------------------------------------------------
Intervyular juda foydali deb o'ylayman, ayniqsa dasturchilar uchun. Sizni o'z sohangizda o'sishingizga yordam beradi va qayerlarda kamchiligingiz bor va nimalarni mustahkamlashingiz kerakligini yaqqol ko'rsatib beradi (xuddi peshonangizni devorga urgandek π ).
Intervyularda olgan natijani to'g'ri qabul qiling, o'zingizga bo'lgan ishonchni so'ndirishiga qo'ymang yoki juda oson o'tgan bo'lsa o'zingizga ortiqcha baho berib miyangizni tormozlab qo'ymang.
Intervyulardan yiqilish yaxshiπ, Chunki keyingilarida yiqilishdan qo'rqmaysiz uje yiqilib ko'rgan bo'lasiz va yanayam yaxshiroq o'rganishingizga turtki bo'ladi.
Haqiqiy intervyudan oldin, do'stlaringizdan yoki tajribasi sizdan ko'proq insonlardan mock intervyular olib ko'rishlarini iltimos qiling, juda kotta yordam beradi bu ham. Hamda bitta joyga emas bir nechta joylarga apply qilib ko'rish kerak.
π3π₯2
#call_stack
The call stack. This is the main structure of a running Python program. It has one itemβa "frame"βfor each currently active function call, with the bottom of the stack being the entry point of the program. Every function call pushes a new frame onto the call stack, and every time a function call returns, its frame is popped off.
Sourse1, source2
The call stack. This is the main structure of a running Python program. It has one itemβa "frame"βfor each currently active function call, with the bottom of the stack being the entry point of the program. Every function call pushes a new frame onto the call stack, and every time a function call returns, its frame is popped off.
Sourse1, source2
print() function returns None in python, which means whenever we call print() it references to None object in python memory.
e.g
my_var = print("something")
!!! Here my_var is None
e.g
my_var = print("something")
!!! Here my_var is None
PyNotes
Title: Namespaces A namespace is a system that has a unique name for each and every object in Python. An object might be a variable or a method. There are 3 types of namespaces: built-in namespaces global namespaces local namespaces e.g var1 = 5 # globalβ¦
Namespaces have different lifetimes, because they are often created at different points in time.
π The namespace containing the built-in names is created when the Python interpreter starts up, and is never deleted.
π The global namespace of a module is generated when the module is read in. Module namespaces normally last until the script ends, i.e. the interpreter quits.
π When a function is called, a local namespace is created for this function. This namespace is deleted either if the function ends, i.e. returns, or if the function raises an exception, which is not dealt with within the function.
source
π The namespace containing the built-in names is created when the Python interpreter starts up, and is never deleted.
π The global namespace of a module is generated when the module is read in. Module namespaces normally last until the script ends, i.e. the interpreter quits.
π When a function is called, a local namespace is created for this function. This namespace is deleted either if the function ends, i.e. returns, or if the function raises an exception, which is not dealt with within the function.
source
python-course.eu
27. Namespaces | Python Tutorial | python-course.eu
Introduction into Namespaces and Scopes in Python
Title: Scope
A scope (visibility of name) refers to a region of a program where a namespace can be directly accessed. Scopes are defined statically, but they are used dynamically.
e.g
var1 = 5 # global scope
def some_func(): # global scope
var2 = 6 # local scope
Python scope concept follows a rule known as the LEGB (Local, Enclosing, Global, and Built-in scopes).
When we call a name, Python starts searching it from local scopes and ends in built-is scopes. If it cannot find, you get a NameError.
A scope (visibility of name) refers to a region of a program where a namespace can be directly accessed. Scopes are defined statically, but they are used dynamically.
e.g
var1 = 5 # global scope
def some_func(): # global scope
var2 = 6 # local scope
Python scope concept follows a rule known as the LEGB (Local, Enclosing, Global, and Built-in scopes).
When we call a name, Python starts searching it from local scopes and ends in built-is scopes. If it cannot find, you get a NameError.
#testing
Types of testing. (short notes)
Manual testing: testing is done without using any tools
βTime consuming
βBoring
βRepetitive
β Lower cost in the short term
β Adaptable
β Flexible
β Easy to identify defects that automation tools may miss
Automated testing: testing is done by using a set of automated tools.
β Those tools can have limitations
β Can be expensive for an organization
βHeavy reliance on tools
β Tests can be executed in parallel
βRepeatable
β Quick and creative
Functional testing - tests whether or not the system is working properly. It can include both functional and automated testing.
Non-functional testing: Tests how well the system meets the requirements (performance, usability, reliability, etc.)
Types of testing. (short notes)
Manual testing: testing is done without using any tools
βTime consuming
βBoring
βRepetitive
β Lower cost in the short term
β Adaptable
β Flexible
β Easy to identify defects that automation tools may miss
Automated testing: testing is done by using a set of automated tools.
β Those tools can have limitations
β Can be expensive for an organization
βHeavy reliance on tools
β Tests can be executed in parallel
βRepeatable
β Quick and creative
Functional testing - tests whether or not the system is working properly. It can include both functional and automated testing.
Non-functional testing: Tests how well the system meets the requirements (performance, usability, reliability, etc.)
#class #constructor
In python every class has a constructor, but its not required to explicitly define it.
the __init__() method is a constructor and is always called when an object is created.
There are two types of constructors:
Default constructor - a simple constructor which doesnβt accept any arguments.
Parameterized constructor - a constructor with arguments.
Source1, Source2
In python every class has a constructor, but its not required to explicitly define it.
the __init__() method is a constructor and is always called when an object is created.
There are two types of constructors:
Default constructor - a simple constructor which doesnβt accept any arguments.
Parameterized constructor - a constructor with arguments.
Source1, Source2
issubclass()
Python issubclass() is built-in function used to check if a class is a subclass of another class or not. This function returns True if the given class is the subclass of given class or any element of the tuple, otherwise False.
It receives two arguments:
issubclass(object, classinfo)
object: class to be checked
classinfo: class, types or a tuple of classes and types
Python issubclass() is built-in function used to check if a class is a subclass of another class or not. This function returns True if the given class is the subclass of given class or any element of the tuple, otherwise False.
It receives two arguments:
issubclass(object, classinfo)
object: class to be checked
classinfo: class, types or a tuple of classes and types
#decorators
Uzoq vaqtdan beri rejalashtirilgan lekin hech qo'lim bormayotgan dekoratorlar mavzusidagi videoni bugun tayyorladik π
https://youtu.be/Lj87Om_E67k
Hozirgina tandirdan uzilgan ))
Uzoq vaqtdan beri rejalashtirilgan lekin hech qo'lim bormayotgan dekoratorlar mavzusidagi videoni bugun tayyorladik π
https://youtu.be/Lj87Om_E67k
Hozirgina tandirdan uzilgan ))
YouTube
Dekoratorlar bilan ishlash (Python)
Dekoratorlar bilan ishlashni sodda misollarda ko'rib chiqamiz.
!! Atribute so'zi ishlatilgan joylarga "argument" so'zi nazarda tutilgan. Chalg'ib ketib qolmang!!
!! Atribute so'zi ishlatilgan joylarga "argument" so'zi nazarda tutilgan. Chalg'ib ketib qolmang!!
Toptal(afzalliklari va kamchiliklari), Toptalga ishga kirish jarayoni va keyingi bosqichlar haqida do'stimiz Vohidjon_Karimjonov ko'p so'ralgan savollarga javob sifatida o'zbek/ingliz tillarida foydali maqola tayyorlagan.
Toptal interview haqida bosqichma-bosqich, tushunarli guide berilgan.
Maqola so'ngida referral linkini ham topasizπ
π https://vovopap.com/2021/12/25/hammasi-toptal-haqida.html
Toptal interview haqida bosqichma-bosqich, tushunarli guide berilgan.
Maqola so'ngida referral linkini ham topasizπ
π https://vovopap.com/2021/12/25/hammasi-toptal-haqida.html
#python
when we import a module(python file), python interpretator searches for that module name in sys.modules.
If it returns False, it will create a new module object and add to sys.modules and then code inside module is executed.
π Therefore, when we import the same module several times in one file, it is executed only once.
when we import a module(python file), python interpretator searches for that module name in sys.modules.
If it returns False, it will create a new module object and add to sys.modules and then code inside module is executed.
π Therefore, when we import the same module several times in one file, it is executed only once.