How Python does Compile-time and Run-time code checking?

Posted by Jennifer | Updated on | Python


How Python does Compile-time and Run-time code checking? In Python, some amount of coding is done at compile time, but most of the checking such as type, name, etc. are postponed until code execution. Consequently, …

What is a negative index in Python?

Posted by Jennifer | Updated on | Python


What is a negative index in Python? Python sequences are accessible using an index in positive and negative numbers. For example, 0 is the first positive index, 1 is the second positive index and so …

How can you convert a number to string?

Posted by Jennifer | Updated on | Python


How can you convert a number to string? We can use the inbuilt function str() to convert a number into a string. If you want an octal or hexadecimal representation, we can use the oct() …

How to send an email in Python Language?

Posted by Andre Scott | Updated on | Python


How to send an email in Python Language? To send an email, Python provides smtplib and email modules. Import these modules into the created mail script and send mail by authenticating a user. It has …

What is pickling and unpickling in Python?

Posted by Andre Scott | Updated on | Python


What is pickling and unpickling in Python? The Python pickle is defined as a module which accepts any Python object and converts it into a string representation. It dumps the Python object into a file …

What is the namespace in Python?

Posted by Jessica Taylor | Updated on | Python


Ans. The namespace is a fundamental idea to structure and organize the code that is more useful in large projects. However, it could be a bit difficult concept to grasp if you’re new to programming. …

How to create a Unicode string in Python?

Posted by Jessica Taylor | Updated on | Python


In Python 3, the old Unicode type has replaced by “str” type, and the string is treated as Unicode by default. We can make a string in Unicode by using art.title.encode(“utf-8”) function.

Explain what is Flask & its benefits?

Posted by Jessica Taylor | Updated on | Python


Flask is a web micro framework for Python based on “Werkzeug, Jinja 2 and good intentions” BSD licensed. Werkzeug and jingja are two of its dependencies. Flask is part of the micro-framework. Which means it …

What are generators in Python?

Posted by Jessica Taylor | Updated on | Python


What are generators in Python? Ans. The way of implementing iterators are known as generators. It is a normal function except that it yields expression in the function.

How are arguments passed by value or by reference?

Posted by Jessica Taylor | Updated on | Python


How are arguments passed by value or by reference? Everything in Python is an object and all variables hold references to the objects. The references values are according to the functions; as a result you …

What is the difference between list and tuple?

Posted by Jessica Taylor | Updated on | Python


What is the difference between list and tuple? The difference between list and tuple is that list is mutable while tuple is not. Tuple can be hashed for e.g as a key for dictionaries.

What are Python decorators?

Posted by Jessica Taylor | Updated on | Python


What are Python decorators? Ans. A Python decorator is a specific change that we make in Python syntax to alter functions easily.

What is docstring in Python?

Posted by Jessica Taylor | Updated on | Python


Documentation string or docstring is a multiline string used to document a specific code segment. The docstring should describe what the function or method does.

What are unittests in Python?

Posted by Jennifer | Updated on | Python


unittest is a unit testing framework of Python. Unit testing means testing different components of software separately. Can you think why unit testing is important? Imagine a scenario, you are building software which uses three …

What is PYTHONPATH in Python?

Posted by Jessica Taylor | Updated on | Python


What is PYTHONPATH in Python? PYTHONPATH is an environment variable which you can set to add additional directories where Python will look for modules and packages. This is especially useful in maintaining Python libraries that …