<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Ask Ghassem - Recent activity in Python Interview Questions</title>
<link>https://ask.ghassem.com/activity/python-interview-questions</link>
<description>Powered by Question2Answer</description>
<item>
<title>Commented: How to filter a dataframe?</title>
<link>https://ask.ghassem.com/775/how-to-filter-a-dataframe?show=1007#c1007</link>
<description>Since it&amp;#039;s the first row you can also do df.head(1).</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/775/how-to-filter-a-dataframe?show=1007#c1007</guid>
<pubDate>Mon, 29 Nov 2021 04:14:50 +0000</pubDate>
</item>
<item>
<title>Answered: How does break, continue and pass work in Python?</title>
<link>https://ask.ghassem.com/711/how-does-break-continue-and-pass-work-in-python?show=712#a712</link>
<description>&lt;p&gt;&lt;strong&gt;break&lt;/strong&gt; allows loop termination when some condition is met and the control is transferred to the next statement.&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;continue&lt;/strong&gt;&amp;nbsp;allows skipping some part of a loop when some specific condition is met and the control is transferred to the beginning of the loop&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pass&lt;/strong&gt; used&amp;nbsp;when you need some block of code syntactically, but you want to skip its execution. This is basically a null operation. Nothing happens when this is&amp;nbsp;executed.&amp;nbsp;&lt;/p&gt;</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/711/how-does-break-continue-and-pass-work-in-python?show=712#a712</guid>
<pubDate>Thu, 11 Jul 2019 17:10:35 +0000</pubDate>
</item>
<item>
<title>Answered: What are self and _init_ in Python classes?</title>
<link>https://ask.ghassem.com/709/what-are-self-and-init-in-python-classes?show=710#a710</link>
<description>&lt;p&gt;&lt;strong&gt;Self&lt;/strong&gt; is an instance or an object of a class. The name self is a convention and can be replaced by any other variable name. The first parameter is considered as &quot;self&quot;. In Python, this is explicitly included as the first parameter. However, this is not the case in Java where it&#039;s optional. It helps to differentiate between the methods and attributes of a class with local variables.&amp;nbsp;&lt;br&gt;
The self variable in the init method refers to the newly created object while in other methods, it refers to the object whose method was called.&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;_init_&lt;/strong&gt; is a method or constructor in Python. This method is automatically called to allocate memory when a new object/instance of a class is created. All classes have the _init_ method.&amp;nbsp;&lt;br&gt;
Here is an example of how to use it:&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
class Employee:
    def _init_(self, name, age.salary): 
        self.name= name 
        self.age = age 
        self.salary = 20000 

El = Employee(&#039;XYZ&#039;, 23, 20000) 
# El is the instance of class Employee. 
# _init_ allocates memory for El. 
print(El.name)
#Output: &#039;XYZ&#039;
print(El.age)
#Output: 23
print(El.salary) 
#Output: 20000
&lt;/pre&gt;</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/709/what-are-self-and-init-in-python-classes?show=710#a710</guid>
<pubDate>Thu, 11 Jul 2019 17:05:32 +0000</pubDate>
</item>
<item>
<title>Answered: What are classes in Python?</title>
<link>https://ask.ghassem.com/707/what-are-classes-in-python?show=708#a708</link>
<description>&lt;h2&gt;Python Classes and Methods (&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.hackerearth.com/practice/python/object-oriented-programming/classes-and-objects-i/tutorial/&quot;&gt;source&lt;/a&gt;)&lt;/h2&gt;

&lt;p&gt;Python is an “&lt;strong&gt;object-oriented programming language.&lt;/strong&gt;” This means that almost all the code is implemented using a special construct called classes. Programmers use classes to keep related things together. This is done using the keyword “class,” which is a grouping of object-oriented constructs.&amp;nbsp;&lt;/p&gt;

&lt;p&gt;By the end of this tutorial you will be able to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define what is a class&lt;/li&gt;
&lt;li&gt;Describe how to create a class&lt;/li&gt;
&lt;li&gt;Define what is a method&lt;/li&gt;
&lt;li&gt;Describe how to do object instantiation&lt;/li&gt;
&lt;li&gt;Describe how to create instance attributes in Python&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;What is a class?&lt;/h2&gt;

&lt;p&gt;A class is a code template for creating objects. Objects have member variables and have behavior associated with them. In python a class is created by the keyword&amp;nbsp;&lt;code&gt;class&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;An object is created using the constructor of the class. This object will then be called the&amp;nbsp;&lt;code&gt;instance&lt;/code&gt;&amp;nbsp;of the class. In Python we create instances in the following manner&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
Instance = class(arguments)&lt;/pre&gt;

&lt;h2&gt;How to create a class&lt;/h2&gt;

&lt;p&gt;The simplest class can be created using the class keyword. For example, let&#039;s create a simple, empty class with no functionalities.&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
class Snake:
    pass

snake = Snake()
print(snake)
# Output: &amp;lt;__main__.Snake object at 0x7f315c573550&amp;gt;&lt;/pre&gt;

&lt;h2&gt;Attributes and Methods in class:&lt;/h2&gt;

&lt;p&gt;A class by itself is of no use unless there is some functionality associated with it. Functionalities are defined by setting attributes, which act as containers for data and functions related to those attributes. Those functions are called methods.&lt;/p&gt;

&lt;h3&gt;Attributes:&lt;/h3&gt;

&lt;p&gt;You can define the following class with the name Snake. This class will have an attribute&amp;nbsp;&lt;code&gt;name&lt;/code&gt;.&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
class Snake:
    name = &quot;python&quot; # set an attribute `name` of the class&lt;/pre&gt;

&lt;p&gt;You can assign the class to a variable. This is called object instantiation. You will then be able to access the attributes that are present inside the class using the dot&amp;nbsp;&lt;code&gt;.&lt;/code&gt;&amp;nbsp;operator. For example, in the Snake example, you can access the attribute&amp;nbsp;&lt;code&gt;name&lt;/code&gt;&amp;nbsp;of the class&amp;nbsp;&lt;code&gt;Snake&lt;/code&gt;.&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
# instantiate the class Snake and assign it to variable snake
snake = Snake()

# access the class attribute name inside the class Snake.
print(snake.name)
# Output: python&lt;/pre&gt;

&lt;h3&gt;Methods&lt;/h3&gt;

&lt;p&gt;Once there are attributes that “belong” to the class, you can define functions that will access the class attribute. These functions are called methods. When you define methods, you will need to always provide the first argument to the method with a self keyword.&lt;/p&gt;

&lt;p&gt;For example, you can define a class&amp;nbsp;&lt;code&gt;Snake&lt;/code&gt;, which has one attribute&amp;nbsp;&lt;code&gt;name&lt;/code&gt;&amp;nbsp;and one method&amp;nbsp;&lt;code&gt;change_name&lt;/code&gt;. The method change name will take in an argument&amp;nbsp;&lt;code&gt;new_name&lt;/code&gt;&amp;nbsp;along with the keyword&amp;nbsp;&lt;code&gt;self&lt;/code&gt;.&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
class Snake:
   name = &quot;python&quot;
   def change_name(self, new_name): # note that the first argument is self
        self.name = new_name # access the class attribute with the self keyword
&lt;/pre&gt;

&lt;p&gt;Now, you can instantiate this class&amp;nbsp;&lt;code&gt;Snake&lt;/code&gt;&amp;nbsp;with a variable&amp;nbsp;&lt;code&gt;snake&lt;/code&gt;&amp;nbsp;and then change the name with the method&amp;nbsp;&lt;code&gt;change_name&lt;/code&gt;.&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
# instantiate the class
snake = Snake()

# print the current object name 
print(snake.name)
# Ouput: python

# change the name using the change_name method
snake.change_name(&quot;anaconda&quot;)
print(snake.name)
# Ouput: anaconda&lt;/pre&gt;

&lt;h3&gt;Instance attributes in python and the init method&lt;/h3&gt;

&lt;p&gt;You can also provide the values for the attributes at runtime. This is done by defining the attributes inside the init method. The following example illustrates this.&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
class Snake:

    def __init__(self, name):
        self.name = name

    def change_name(self, new_name):
        self.name = new_name&lt;/pre&gt;

&lt;p&gt;Now you can directly define separate attribute values for separate objects. For example:&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
# two variables are instantiated
python = Snake(&quot;python&quot;)
anaconda = Snake(&quot;anaconda&quot;)

# print the names of the two variables
print(python.name)
# Output: python
print(anaconda.name)
# Output: anaconda
&lt;/pre&gt;</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/707/what-are-classes-in-python?show=708#a708</guid>
<pubDate>Thu, 11 Jul 2019 16:51:13 +0000</pubDate>
</item>
<item>
<title>Answered: What are functions In Python?</title>
<link>https://ask.ghassem.com/705/what-are-functions-in-python?show=706#a706</link>
<description>&lt;p&gt;A function is a block of code which is executed only when it is called. To define a Python function, the &lt;strong&gt;def&lt;/strong&gt; keyword is used. &amp;nbsp;&lt;/p&gt;

&lt;p&gt;Example:&amp;nbsp;&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
def hello(): 
    print(&quot;Hello World!&quot;)

hello() # calling the function
# Output: &quot;Hello World!&quot;&lt;/pre&gt;


</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/705/what-are-functions-in-python?show=706#a706</guid>
<pubDate>Thu, 11 Jul 2019 16:26:02 +0000</pubDate>
</item>
<item>
<title>Answered: What is the difference between Python Arrays and Lists?</title>
<link>https://ask.ghassem.com/703/what-is-the-difference-between-python-arrays-and-lists?show=704#a704</link>
<description>&lt;p&gt;Arrays and Lists, in Python, have the same way of storing data. But, Arrays can hold only a single data type elements whereas Lists can hold any data type elements.&amp;nbsp;&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
import array as arr 
My_Array=arr.array(&#039;i&#039;,[1,2,3,41]) 
My_list=[l,&#039;abc&#039;,1.20] 
print(My_Array) 
print(My_list) &lt;/pre&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
array(&#039;i&#039;, [1, 2, 3, 4]) 
[1, &#039;abc&#039;, 1.2] &lt;/pre&gt;

&lt;p&gt;In the example above, in&amp;nbsp;&lt;em&gt;My_Array&lt;/em&gt;, typecode used is &lt;strong&gt;i&lt;/strong&gt;. This typecode represents signed integer whose size is 2 bytes.&lt;/p&gt;</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/703/what-is-the-difference-between-python-arrays-and-lists?show=704#a704</guid>
<pubDate>Thu, 11 Jul 2019 16:22:15 +0000</pubDate>
</item>
<item>
<title>Answered: Is indentation required in Python?  Is Python case-sensitive?</title>
<link>https://ask.ghassem.com/701/is-indentation-required-in-python-is-python-case-sensitive?show=702#a702</link>
<description>Python is a case-sensitive language. indentation is also necessary for Python. It specifies a block of code. All code within loops, classes, functions, etc is specified within an indented block. It is usually done using four space characters. If your code is not indented necessarily, it will not execute accurately and will throw errors as well.</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/701/is-indentation-required-in-python-is-python-case-sensitive?show=702#a702</guid>
<pubDate>Thu, 11 Jul 2019 16:17:37 +0000</pubDate>
</item>
<item>
<title>Answered: What is type conversion in Python?</title>
<link>https://ask.ghassem.com/699/what-is-type-conversion-in-python?show=700#a700</link>
<description>&lt;p&gt;Type conversion refers to the conversion of one data type into another.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;int() &lt;/strong&gt;- converts any data type into integer type&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;float() &lt;/strong&gt;- converts any data type into float type&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ord()&lt;/strong&gt; - converts characters into integer&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;hex() &lt;/strong&gt;- converts integers to hexadecimal&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;oct()&lt;/strong&gt;&amp;nbsp;- converts integer to octal&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tuple()&amp;nbsp;&lt;/strong&gt;- This function is used to convert to a tuple.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;set()&amp;nbsp;&lt;/strong&gt;- This function returns the type after converting to set.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;list()&lt;/strong&gt;&amp;nbsp;- This function is used to convert any data type to a list type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;dict()&lt;/strong&gt;&amp;nbsp;- This function is used to convert a tuple of order (key,value) into a dictionary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;str()&lt;/strong&gt; - Used to convert integer into a string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;complex(real,image)&lt;/strong&gt; - This function converts real numbers to complex(real,image) number.&lt;/p&gt;</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/699/what-is-type-conversion-in-python?show=700#a700</guid>
<pubDate>Tue, 09 Jul 2019 19:50:17 +0000</pubDate>
</item>
<item>
<title>Answered: What are the local variables and global variables in Python?</title>
<link>https://ask.ghassem.com/697/what-are-the-local-variables-and-global-variables-in-python?show=698#a698</link>
<description>&lt;p&gt;&lt;strong&gt;Global Variables:&amp;nbsp;&lt;/strong&gt;&lt;br&gt;
Variables declared outside a function or in global space are called global variables. These variables can be accessed by any function in the program.&amp;nbsp;&lt;br&gt;
&lt;br&gt;
&lt;strong&gt;Local Variables:&amp;nbsp;&lt;/strong&gt;&lt;br&gt;
Any variable declared inside a function is known as a local variable. This variable is present in the local space and not in the global space.&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
a=2 #Global Variable
def add():
    b=3   #Local Variable
    c=a+b #Local Variable
    print(c)
add()&lt;/pre&gt;

&lt;p&gt;When you try to access the local variable outside the function add(), it will throw an error.&lt;/p&gt;</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/697/what-are-the-local-variables-and-global-variables-in-python?show=698#a698</guid>
<pubDate>Tue, 09 Jul 2019 19:10:31 +0000</pubDate>
</item>
<item>
<title>Answered: What are python modules? Name some commonly used built-in modules in Python?</title>
<link>https://ask.ghassem.com/695/what-python-modules-name-some-commonly-built-modules-python?show=696#a696</link>
<description>&lt;p&gt;Python modules are files containing Python code. This code can either be functions classes or variables. A Python module is a .py file containing executable code.&amp;nbsp;&lt;br&gt;
Some of the commonly used built-in modules are:&amp;nbsp;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;datatime&lt;/li&gt;
&lt;li&gt;JSON&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/695/what-python-modules-name-some-commonly-built-modules-python?show=696#a696</guid>
<pubDate>Tue, 09 Jul 2019 19:06:43 +0000</pubDate>
</item>
<item>
<title>Answered: What is PYTHONPATH in Python?</title>
<link>https://ask.ghassem.com/693/what-is-pythonpath-in-python?show=694#a694</link>
<description>lt is an environment variable which is used when a module is imported. Whenever a module is imported, PYTHONPATH is also looked up to check for the presence of the imported modules in various directories. The interpreter uses it to determine which module to load.</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/693/what-is-pythonpath-in-python?show=694#a694</guid>
<pubDate>Tue, 09 Jul 2019 19:01:49 +0000</pubDate>
</item>
<item>
<title>Edited: What is a namespace in Python?</title>
<link>https://ask.ghassem.com/691/what-is-a-namespace-in-python?show=691#q691</link>
<description></description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/691/what-is-a-namespace-in-python?show=691#q691</guid>
<pubDate>Tue, 09 Jul 2019 18:57:38 +0000</pubDate>
</item>
<item>
<title>Answered: How is memory management in Python?</title>
<link>https://ask.ghassem.com/689/how-is-memory-management-in-python?show=690#a690</link>
<description>&lt;ul&gt;
&lt;li&gt;Memory management in python is performed&amp;nbsp;by &lt;strong&gt;Python private&amp;nbsp;heap space&lt;/strong&gt;. All Python objects and data structures are located in a private heap. The programmer does not have access to this private heap. The python interpreter takes care of this instead.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The allocation of heap space for Python objects is done by Python&#039;s memory manager. The core API gives access to some tools for the programmer to code.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Python also has an inbuilt garbage collector, which recycles all the unused memory and so that it can be made available to the heap space.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/689/how-is-memory-management-in-python?show=690#a690</guid>
<pubDate>Tue, 09 Jul 2019 18:51:01 +0000</pubDate>
</item>
<item>
<title>Answered: What is PEP8 in Python?</title>
<link>https://ask.ghassem.com/687/what-is-pep8-in-python?show=688#a688</link>
<description>&lt;p&gt;&lt;strong&gt;PEP&lt;/strong&gt; stands for &lt;strong&gt;Python Enhancement Proposa&lt;/strong&gt;l.&amp;nbsp;It is a set of rules that specify how to format Python code for maximum readability.&amp;nbsp;&lt;/p&gt;</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/687/what-is-pep8-in-python?show=688#a688</guid>
<pubDate>Tue, 09 Jul 2019 18:40:05 +0000</pubDate>
</item>
<item>
<title>Answered: How is Python an interpreted language?</title>
<link>https://ask.ghassem.com/685/how-is-python-an-interpreted-language?show=686#a686</link>
<description>An interpreted language is any programming language which is not in machine level code before runtime. Therefore, Python is an interpreted language.</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/685/how-is-python-an-interpreted-language?show=686#a686</guid>
<pubDate>Tue, 09 Jul 2019 18:38:11 +0000</pubDate>
</item>
<item>
<title>Answered: What type of language is python? Programming or scripting?</title>
<link>https://ask.ghassem.com/683/what-type-of-language-is-python-programming-or-scripting?show=684#a684</link>
<description>Python is capable of scripting, but in general sense, it is considered as a general-purpose programming language.</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/683/what-type-of-language-is-python-programming-or-scripting?show=684#a684</guid>
<pubDate>Tue, 09 Jul 2019 18:35:37 +0000</pubDate>
</item>
<item>
<title>Answered: What are the key features of Python?</title>
<link>https://ask.ghassem.com/681/what-are-the-key-features-of-python?show=682#a682</link>
<description>&lt;ul&gt;
&lt;li&gt;Python is an &lt;strong&gt;Interpreted&lt;/strong&gt; language. That means that, unlike languages like C and its variants, Python does not need to be compiled before it is run. Other interpreted languages include PHP&amp;nbsp;and Ruby.&amp;nbsp;&lt;br&gt;
&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Python is &lt;strong&gt;dynamically typed&lt;/strong&gt;, this means that you don&#039;t need to state the types of variables when you declare them or anything like that. You can do things like &lt;em&gt;x=111&lt;/em&gt; and then &lt;em&gt;x=&quot;I &#039;m a string&quot; &lt;/em&gt;without error&amp;nbsp;&lt;br&gt;
&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Python is well suited to &lt;strong&gt;object orientated programming&lt;/strong&gt; in that it allows the definition of classes along with composition and inheritance. Python does not have access specifiers (like C++&#039;s public, private).&amp;nbsp;&lt;br&gt;
&amp;nbsp;&lt;/li&gt;
&lt;li&gt;In Python, &lt;strong&gt;functions&lt;/strong&gt; are &lt;strong&gt;first-dass objects&lt;/strong&gt;. This means that they &lt;strong&gt;can be assigned to variables&lt;/strong&gt;, returned from other functions and passed into functions. &lt;strong&gt;Classes are also first class objects&lt;/strong&gt;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Writing &lt;strong&gt;Python code is quick&lt;/strong&gt; but running it is often &lt;strong&gt;slower than compiled languages&lt;/strong&gt;. Fortunately,&amp;nbsp;&lt;strong&gt;Python allows the inclusion of C based extensions&lt;/strong&gt; so bottlenecks can be optimized away and often are. The Numpy package is a good example of this, it&#039;s really quite quick because a lot of the number crunching it does isn&#039;t actually done by Python&amp;nbsp;&lt;br&gt;
&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Python finds use&lt;strong&gt; in many spheres&lt;/strong&gt; - web applications, automation, scientific modeling, big data applications and many more. It&#039;s also often &lt;strong&gt;used as &quot;glue&quot; code&lt;/strong&gt; to get other languages and components to play nice.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/681/what-are-the-key-features-of-python?show=682#a682</guid>
<pubDate>Tue, 09 Jul 2019 18:29:32 +0000</pubDate>
</item>
<item>
<title>Answered: What is the difference between list and tuples in Python?</title>
<link>https://ask.ghassem.com/679/what-is-the-difference-between-list-and-tuples-in-python?show=680#a680</link>
<description>&lt;table border=&quot;1&quot; cellpadding=&quot;1&quot; style=&quot;width:500px; border-spacing: 1px;&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th scope=&quot;col&quot;&gt;List&lt;/th&gt;
&lt;th scope=&quot;col&quot;&gt;Tuple&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Lists are mutable i.e they can be edited. &amp;nbsp;&lt;/td&gt;
&lt;td&gt;Tuples are immutable (tuples are lists which can&#039;t be edited).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lists are slower than tuples.&amp;nbsp;&lt;/td&gt;
&lt;td&gt;Tuples are faster than list.&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Syntax: list_ 1 = [10, &#039;Chelsea&#039;, 20)&lt;/td&gt;
&lt;td&gt;Syntax: tup_ 1 = (10, &#039;Chelsea&#039; , 20)&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;


</description>
<category>Python Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/679/what-is-the-difference-between-list-and-tuples-in-python?show=680#a680</guid>
<pubDate>Tue, 09 Jul 2019 18:23:28 +0000</pubDate>
</item>
</channel>
</rss>