Questions #1


Technical Interview Questions/Python Interview Questions with Answers



Download 85,32 Kb.
bet24/24
Sana06.07.2022
Hajmi85,32 Kb.
#752107
1   ...   16   17   18   19   20   21   22   23   24
Bog'liq
interview en

Technical Interview Questions/Python Interview Questions with Answers


B65. How is code executed in python?
Python files are first compiled into bytecode, which is then executed.
B66. What is the parameter passing mechanism in python.
Python uses passing parameters by reference. If you change a parameter inside a function, it will be reflected in the output of the function. However, if you use literals (strings, numbers, tuples) as parameters, then they are passed by value (because they are immutable).
B67. What is with in python?
This instruction ensures that the cleanup code is executed after the execution of the program. For example, you can use it to open a file, do something with it, and automatically close the file when you're done. Similarly, you can open a database connection and automatically close it. The cleanup code is executed even if an exception occurs.
>>> with open('data.txt') as data:
# executable block
B68. How is a .pyc file different from a .py file?
Both files contain bytecode, but .pyc is the compiled version of the python file. Its bytecode is platform independent, so it runs on all platforms that support the .pyc format.
B69. What makes python object-oriented?
It follows the object-oriented programming paradigm, which is built around classes (classes) and their instances (instances). This allows you to implement the following functions:
- hiding the internal data structure
- abstraction
- inheritance
- polymorphism (the ability to choose the right method depending on the type of data)
- data access restriction
B70. What are the object types in Python?
Python supports both mutable and immutable object types.
Immutable do not allow you to change your content. Examples: tuples, booleans, strings, numbers. Iterating over them is faster.
Modifiable allows you to modify your content. Examples: lists, sets, and dictionaries. Iteration over them is slower.
Download 85,32 Kb.

Do'stlaringiz bilan baham:
1   ...   16   17   18   19   20   21   22   23   24




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish