<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Python Tutorial | Python Programming Language - Medium]]></title>
        <description><![CDATA[Python is a simple, general purpose, high level, and object-oriented programming language.   Python is an interpreted scripting language, also. Guido Van Rossum is known as the founder of Python programming. - Medium]]></description>
        <link>https://medium.com/python-tutorial-python-programming-language?source=rss----d6d0bcd8c0fa---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Python Tutorial | Python Programming Language - Medium</title>
            <link>https://medium.com/python-tutorial-python-programming-language?source=rss----d6d0bcd8c0fa---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 13 Nov 2026 05:57:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/python-tutorial-python-programming-language" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Python literals — Python Tutorial]]></title>
            <link>https://medium.com/python-tutorial-python-programming-language/python-literals-python-tutorial-888152a6f3e5?source=rss----d6d0bcd8c0fa---4</link>
            <guid isPermaLink="false">https://medium.com/p/888152a6f3e5</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[pythonweb]]></category>
            <category><![CDATA[python-literals]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Rajguleria]]></dc:creator>
            <pubDate>Fri, 13 Jan 2023 09:15:03 GMT</pubDate>
            <atom:updated>2023-01-13T09:15:03.394Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python literals — Python Tutorial</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*21Tlig9ItcDhPa-tFYptDQ.jpeg" /><figcaption>python tutorial</figcaption></figure><p>Python literals can be defined as data that is given in a variable or constant.</p><p>Python supports the following literals:</p><h3>1. String literals:</h3><p>String literals can be formed by enclosing a text in quotes. We can use both single and double quotes to create a string.</p><p><strong>Example:</strong></p><pre>&quot;Aman&quot; , &#39;12345&#39;  </pre><p><strong>Types of Strings:</strong></p><p>There are two types of strings supported in Python:</p><p><strong>a) Single-line Strings:</strong> Strings that are terminated within a single line are known as single-line strings.</p><p><strong>Example:</strong></p><pre>text1=&#39;hello&#39;  </pre><p><strong>b) Multi-line String: </strong>A piece of text that is written in multiple lines is known as a &quot;multi-line string.&quot;</p><p>There are two ways to create multiline strings:</p><ol><li><strong>Adding black slash at the end of each line.</strong></li></ol><p><strong>Example:</strong></p><pre>text1=&#39;hello\    <br>user&#39;    <br>print(text1)  </pre><pre>&#39;hellouser&#39; </pre><p><strong>2) Using triple quotation marks: marks: -</strong></p><p><strong>Example:</strong></p><pre>str2=&#39;&#39;&#39;&#39;&#39;welcome  <br>to  <br>SSSIT&#39;&#39;&#39;    <br>print str2   </pre><p><strong>Output:</strong></p><pre>welcome  <br>to  <br>SSSIT  </pre><h3>II. Numeric literals:</h3><p>Numeric literals are immutable. Numeric literals can belong to the following four different numerical types:</p><p>Int(signed integers) Long(long integers) float(floating point) Complex(complex)</p><p>Numbers (which can be both positive and negative) with no fractional part. eg: 100</p><p>Integers of unlimited size followed by lowercase or uppercase L eg: 87032845L</p><p>Real numbers with both integer and fractional part eg: -26.2</p><p>in the form of a+bj, where a forms the real part and b forms the imaginary part of the complex number. eg: 3.14j</p><p><strong>Example — Numeric Literals</strong></p><pre>x = 0b10100 #Binary Literals  <br>y = 100 #Decimal Literal   <br>z = 0o215 #Octal Literal  <br>u = 0x12d #Hexadecimal Literal  <br>  <br>#Float Literal  <br>float_1 = 100.5   <br>float_2 = 1.5e2  <br>  <br>#Complex Literal   <br>a = 5+3.14j  <br>  <br>print(x, y, z, u)  <br>print(float_1, float_2)  <br>print(a, a.imag, a.real)  </pre><p><strong>Output:</strong></p><pre>20 100 141 301<br>100.5 150.0<br>(5+3.14j) 3.14 5.0</pre><h3>III. Boolean literals:</h3><p>A Boolean literal can have any of two values: True or False.</p><p><strong>Example —Boolean Literals</strong></p><pre>x = (1 == True)  <br>y = (2 == False)  <br>z = (3 == True)  <br>a = True + 10  <br>b = False + 10  <br>  <br>print(&quot;x is&quot;, x)  <br>print(&quot;y is&quot;, y)  <br>print(&quot;z is&quot;, z)  <br>print(&quot;a:&quot;, a)  <br>print(&quot;b:&quot;, b)  </pre><p><strong>Output:</strong></p><pre>x is True<br>y is False<br>z is False<br>a: 11<br>b: 10</pre><h3>IV. Special literals.</h3><p>Python contains one special literal, i.e., <strong>None.</strong></p><p>None is used to specify a field that is not created. It is also used for the end of lists in Python.</p><p><strong>Example — Special Literals</strong></p><pre>val1=10    <br>val2=None    <br>print(val1)     <br>print(val2)   </pre><p><strong>Output:</strong></p><pre>10<br>None</pre><h3>V. Literal Collections.</h3><p>Python provides four types of literal collection: list literals, tuple literals, dictionary literals, and set literals.</p><p><strong>List:</strong></p><ul><li>List contains items of different data types. Lists are mutable i.e.., modifiable.</li><li>The values stored in List are separated by comma(,) and enclosed within square brackets([]). We can store different types of data in a List.</li></ul><p><strong>Example — List literals</strong></p><pre>list=[&#39;John&#39;,678,20.4,&#39;Peter&#39;]    <br>list1=[456,&#39;Andrew&#39;]    <br>print(list)    <br>print(list + list1)  </pre><p><strong>Output:</strong></p><pre>[&#39;John&#39;, 678, 20.4, &#39;Peter&#39;]<br>[&#39;John&#39;, 678, 20.4, &#39;Peter&#39;, 456, &#39;Andrew&#39;]</pre><p><strong>Dictionary:</strong></p><ul><li>Python dictionary stores the data in the key-value pair.</li><li>It is enclosed by curly-braces {} and each pair is separated by the commas(,).</li></ul><p><strong>Example</strong></p><pre>dict = {&#39;name&#39;: &#39;Pater&#39;, &#39;Age&#39;:18,&#39;Roll_nu&#39;:101}  <br>print(dict)  </pre><p><strong>Output:</strong></p><pre>{&#39;name&#39;: &#39;Pater&#39;, &#39;Age&#39;: 18, &#39;Roll_nu&#39;: 101}</pre><p><strong>Tuple:</strong></p><ul><li>Python tuple is a collection of different data-type. It is immutable which means it cannot be modified after creation.</li><li>It is enclosed by the parentheses () and each element is separated by the comma(,).</li></ul><p><strong>Example</strong></p><pre>tup = (10,20,&quot;Dev&quot;,[2,3,4])  <br>print(tup)  </pre><p><strong>Output:</strong></p><pre>(10, 20, &#39;Dev&#39;, [2, 3, 4])</pre><p><strong>Set:</strong></p><ul><li>Python set is the collection of the unordered dataset.</li><li>It is enclosed by the {} and each element is separated by the comma(,).</li></ul><p><strong>Example: — Set Literals</strong></p><pre>set = {&#39;apple&#39;,&#39;grapes&#39;,&#39;guava&#39;,&#39;papaya&#39;}  <br>print(set)  </pre><p><strong>Output:</strong></p><pre>{&#39;guava&#39;, &#39;apple&#39;, &#39;papaya&#39;, &#39;grapes&#39;}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=888152a6f3e5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/python-tutorial-python-programming-language/python-literals-python-tutorial-888152a6f3e5">Python literals — Python Tutorial</a> was originally published in <a href="https://medium.com/python-tutorial-python-programming-language">Python Tutorial | Python Programming Language</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python keywords — Python Tutorial]]></title>
            <link>https://medium.com/python-tutorial-python-programming-language/python-keywords-python-tutorial-4edc6e3775b3?source=rss----d6d0bcd8c0fa---4</link>
            <guid isPermaLink="false">https://medium.com/p/4edc6e3775b3</guid>
            <category><![CDATA[list-of-python-keywords]]></category>
            <category><![CDATA[all-python-keywords]]></category>
            <category><![CDATA[python-keywords]]></category>
            <category><![CDATA[python-keywords-list]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Rajguleria]]></dc:creator>
            <pubDate>Fri, 13 Jan 2023 08:25:32 GMT</pubDate>
            <atom:updated>2023-01-13T08:25:32.828Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python keywords — Python Tutorial</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3MRCo1uq0uvYpkwwRTyJdg.jpeg" /><figcaption>python tutorial</figcaption></figure><p>Every scripting language has designated words or keywords with particular definitions and usage guidelines. Python is no exception. The fundamental constituent elements of any Python program are Python keywords.</p><p>This tutorial will give you a basic overview of all Python keywords and a detailed discussion of some important keywords that are frequently used.</p><h3>Introducing Python Keywords</h3><p>Python keywords are unique words reserved with defined meanings and functions that we can only apply for those functions. You’ll never need to import any keywords into your program because they’re already there.</p><p>Python’s built-in methods and classes are not the same as the keywords. Built-in methods and classes are constantly present; however, they are not as limited in their application as keywords.</p><p>Assigning a particular meaning to Python keywords means you can’t use them for other purposes in our code. You’ll get a message of SyntaxError if you attempt to do the same. If you attempt to assign anything to a built-in method or type, you will not receive a SyntaxError message; however, it is still not a smart idea.</p><p>Python contains thirty-five keywords in the most recent version, i.e., Python 3.8.</p><p>In distinct versions of Python, the preceding keywords might be changed. Some extras may be introduced, while others may be deleted. By writing the following statement into the coding window, you can anytime retrieve the collection of keywords in the version you are working on.</p><p><strong>Code</strong></p><pre># Python program to demonstrate the application of iskeyword()  <br># importing keyword library which has lists  <br>import keyword  <br>    <br># displaying the complete list using &quot;kwlist().&quot;  <br>print(&quot;The set of keywords in this version is: &quot;)  <br>print( keyword.kwlist )  </pre><p><strong>Output:</strong></p><pre>The set of keywords in this version is : <br>[&#39;False&#39;, &#39;None&#39;, &#39;True&#39;, &#39;and&#39;, &#39;as&#39;, &#39;assert&#39;, &#39;async&#39;, &#39;await&#39;, &#39;break&#39;, &#39;class&#39;, &#39;continue&#39;, &#39;def&#39;, &#39;del&#39;, &#39;elif&#39;, &#39;else&#39;, &#39;except&#39;, &#39;finally&#39;, &#39;for&#39;, &#39;from&#39;, &#39;global&#39;, &#39;if&#39;, &#39;import&#39;, &#39;in&#39;, &#39;is&#39;, &#39;lambda&#39;, &#39;nonlocal&#39;, &#39;not&#39;, &#39;or&#39;, &#39;pass&#39;, &#39;raise&#39;, &#39;return&#39;, &#39;try&#39;, &#39;while&#39;, &#39;with&#39;, &#39;yield&#39;]</pre><p>By calling help(), you can retrieve a list of currently offered keywords:</p><p><strong>Code</strong></p><pre>help(&quot;keywords&quot;)  </pre><h3>How to Identify Python Keywords</h3><p>Python’s keyword collection has evolved as new versions were introduced. The await and async keywords, for instance, were not introduced till Python 3.7. Also, in Python 2.7, the words print and exec constituted keywords; however, in Python 3+, they were changed into built-in methods and are no longer part of the set of keywords. In the paragraphs below, you’ll discover numerous methods for determining whether a particular word in Python is a keyword or not.</p><h3>Write Code on a Syntax Highlighting IDE</h3><p>There are plenty of excellent Python IDEs available. They’ll all highlight keywords to set them apart from the rest of the terms in the code. This facility will assist you in immediately identifying Python keywords during coding so that you do not misuse them.</p><h3>Verify Keywords with Script in a REPL</h3><p>There are several ways to detect acceptable Python keywords plus know further regarding them in the Python REPL.</p><h3>Look for a SyntaxError</h3><p>Lastly, if you receive a SyntaxError when attempting to allocate to it, name a method with it, or do anything else with that, and it isn’t permitted, it’s probably a keyword. This one is somewhat more difficult to see, but it is still a technique for Python to tell you if you’re misusing a keyword.</p><h3>Python Keywords and Their Usage</h3><p>The following sections categorize Python keywords under the headings based on their frequency of use. The first category, for instance, includes all keywords utilized as values, whereas the next group includes keywords employed as operators. These classifications will aid in understanding how keywords are employed and will assist you in arranging the huge collection of Python keywords.</p><ul><li>A few terms mentioned in the segment following may be unfamiliar to you. They’re explained here, and you must understand what they mean before moving on:</li><li>The Boolean assessment of a variable is referred to as truthfulness. A value’s truthfulness reveals if the value of the variable is true or false.</li></ul><p>In the Boolean paradigm, truth refers to any variable that evaluates to true. Pass an item as an input to bool() to see if it is true. If True is returned, the value of the item is true. Strings and lists which are not empty, non-zero numbers, and many other objects are illustrations of true values.</p><p>False refers to any item in a Boolean expression that returns false. Pass an item as an input to bool() to see if it is false. If False is returned, the value of the item is false. Examples of false values are “ “, 0, { }, and [ ].</p><h3>Value Keywords: True, False, None</h3><p>Three Python keywords are employed as values in this example. These are singular values, which we can reuse indefinitely and every time correspond to the same entity. These values will most probably be seen and used frequently.</p><p><strong>The Keywords True and False</strong></p><p>These keywords are typed in lowercase in conventional computer languages (true and false); however, they are typed in uppercase in Python every time. In Python script, the True Python keyword represents the Boolean true state. False is a keyword equivalent to True, except it has the negative Boolean state of false.</p><p>True and False are those keywords that can be allocated to variables or parameters and are compared directly.</p><p><strong>Code</strong></p><pre>print( 4 == 4 )  <br>print( 6 &gt; 9 )  <br>print( True or False )  <br>print( 9 &lt;= 28 )  <br>print( 6 &gt; 9 )  <br>print( True and False )  </pre><p><strong>Output:</strong></p><pre>True<br>False<br>True<br>True<br>False<br>False</pre><p>Because the first, third, and fourth statements are true, the interpreter gives True for those and False for other statements. True and False are the equivalent in Python as 1 &amp; 0. We can use the accompanying illustration to support this claim:</p><p><strong>Code</strong></p><pre>print( True == 3 )  <br>print( False == 0 )  <br>print( True + True + True)  </pre><p><strong>Output:</strong></p><pre>False<br>True<br>3</pre><p><strong>The None Keyword</strong></p><p>None is a Python keyword that means “nothing.” None is known as nil, null, or undefined in different computer languages.</p><p>If a function does not have a return clause, it will give None as the default output:</p><p><strong>Code</strong></p><pre>print( None == 0 )  <br>print( None == &quot; &quot; )  <br>print( None == False )  <br>A = None   <br>B = None  <br>print( A == B )  </pre><p><strong>Output:</strong></p><pre>False<br>False<br>False<br>True</pre><p>If a no_return_function returns nothing, it will simply return a None value. None is delivered by functions that do not meet a return expression in the program flow. Consider the following scenario:</p><p><strong>Code</strong></p><pre>def no_return_function():  <br>    num1 = 10  <br>    num2 = 20  <br>    addition = num1 + num2  <br>  <br>number = no_return_function()  <br>print( number )  </pre><p><strong>Output:</strong></p><pre>None</pre><p>This program has a function with_return that performs multiple operations and contains a return expression. As a result, if we display a number, we get None, which is given by default when there is no return statement. Here’s an example showing this:</p><p><strong>Code</strong></p><pre>def with_return( num ):  <br>    if num % 4 == 0:  <br>        return False  <br>  <br>number = with_return( 67 )  <br>print( number )  </pre><p><strong>Output:</strong></p><pre>None</pre><h3>Operator Keywords: and, or, not, in, is</h3><p>Several Python keywords are employed as operators to perform mathematical operations. In many other computer languages, these operators are represented by characters such as &amp;, |, and!. All of these are keyword operations in Python:</p><p>Writers created Python programming with clarity in mind. As a result, many operators in other computer languages that employ characters in Python are English words called keywords.</p><p><strong>The and Keyword</strong></p><p>The Python keyword and determines whether both the left-hand side and right-hand side operands and are true or false. The outcome will be True if both components are true. If one is false, the outcome will also be False:</p><p>It’s worth noting that the outcomes of an and statement aren’t always True or False. Due to and’s peculiar behavior, this is the case. Instead of processing the inputs to corresponding Boolean values, it just gives &lt;component1&gt; if it is false or &lt;component2&gt; if it is true. The outputs of a and expression could be utilized with a conditional if clause or provided to bool() to acquire an obvious True or False answer.</p><p><strong>The or Keyword</strong></p><pre>&lt;component1&gt; or &lt;component2&gt;  <br></pre><p>The or keyword in Python is utilized to check if, at minimum, 1 of the inputs is true. If the first argument is true, the or operation yields it; otherwise, the second argument is returned:</p><p>Similarly to the and keyword, the or keyword does not change its inputs to corresponding Boolean values. Instead, the outcomes are determined based on whether they are true or false.</p><p><strong>The not Keyword</strong></p><p>The not keyword in Python is utilized to acquire a variable’s contrary Boolean value:</p><p>The not keyword is employed to switch the Boolean interpretation or outcome in conditional sentences or other Boolean equations. Not, unlike and, and or, determines the specific Boolean state, True or False, afterward returns the inverse.</p><p><strong>Code</strong></p><pre>False and True  <br>False or True  <br>not True  </pre><p><strong>Output:</strong></p><pre>False<br>True<br>False</pre><p><strong>The in Keyword</strong></p><p>The in keyword of Python is a robust confinement checker, also known as a membership operator. If you provide it an element to seek and a container or series to seek into, it will give True or False, depending on if that given element was located in the given container:</p><pre>&lt;an_element&gt; in &lt;a_container&gt;  </pre><p>Testing for a certain character in a string is a nice illustration of how to use the in keyword:</p><p><strong>Code</strong></p><pre>container = &quot;Javatpoint&quot;  <br>print( &quot;p&quot; in container )  <br>print( &quot;P&quot; in container )  </pre><p><strong>Output:</strong></p><pre>True<br>False</pre><p>Lists, dictionaries, tuples, strings, or any data type with the method __contains__(), or we can iterate over it will work with the in keyword.</p><p><strong>The is Keyword</strong></p><p>In Python, it’s used to check the identification of objects. The == operation is used to determine whether two arguments are identical. It also determines whether two arguments relate to the unique object.</p><p>When the objects are the same, it gives True; otherwise, it gives False.</p><p><strong>Code</strong></p><pre>print( True is True )  <br>print( False is True )  <br>print( None is not None )  <br>print( (9 + 5) is (7 * 2) )  </pre><p><strong>Output:</strong></p><pre>True<br>False<br>False<br>True</pre><p>True, False, and None are all the same in Python since there is just one version.</p><p><strong>Code</strong></p><pre>print( [] == [] )  <br>print( [] is [] )  <br>print( {} == {} )  <br>print( {} is {} )  </pre><p><strong>Output:</strong></p><pre>True<br>False<br>True<br>False</pre><p>A blank dictionary or list is the same as another blank one. However, they aren’t identical entities because they are stored independently in memory. This is because both the list and the dictionary are changeable.</p><p><strong>Code</strong></p><pre>print( &#39;&#39; == &#39;&#39; )  <br>print( &#39;&#39; is &#39;&#39; )  </pre><p><strong>Output:</strong></p><pre>True<br>True</pre><p>Strings and tuples, unlike lists and dictionaries, are unchangeable. As a result, two equal strings or tuples are also identical. They’re both referring to the unique memory region.</p><h3>The nonlocal Keyword</h3><p>Nonlocal keyword usage is fairly analogous to global keyword usage. The keyword nonlocal is designed to indicate that a variable within a function that is inside a function, i.e., a nested function is just not local to it, implying that it is located in the outer function. We must define a non-local parameter with nonlocal if we ever need to change its value under a nested function. Otherwise, the nested function creates a local variable using that title. The example below will assist us in clarifying this.</p><p><strong>Code</strong></p><pre>def the_outer_function():  <br>    var = 10  <br>    def the_inner_function():  <br>        nonlocal var  <br>        var = 14  <br>        print(&quot;The value inside the inner function: &quot;, var)  <br>    the_inner_function()  <br>    print(&quot;The value inside the outer function: &quot;, var)  <br>  <br>the_outer_function()  </pre><p><strong>Output:</strong></p><pre>The value inside the inner function:  14<br>The value inside the outer function:  14</pre><p>the_inner_function() is placed inside the_outer_function in this case.</p><p>The the_outer_function has a variable named var. Var is not a global variable, as you may have noticed. As a result, if we wish to change it inside the the_inner_function(), we should declare it using nonlocal.</p><p>As a result, the variable was effectively updated within the nested the_inner_function, as evidenced by the results. The following is what happens if you don’t use the nonlocal keyword:</p><p><strong>Code</strong></p><pre>def the_outer_function():  <br>    var = 10  <br>    def the_inner_function():  <br>        var = 14  <br>        print(&quot;Value inside the inner function: &quot;, var)  <br>    the_inner_function()  <br>    print(&quot;Value inside the outer function: &quot;, var)  <br>  <br>the_outer_function()  </pre><p><strong>Output:</strong></p><pre>Value inside the inner function:  14<br>Value inside the outer function:  10</pre><h3>Iteration Keywords: for, while, break, continue</h3><p>The iterative process and looping are essential programming fundamentals. To generate and operate with loops, Python has multiple keywords. These would be utilized and observed in almost every Python program. Knowing how to use them correctly can assist you in becoming a better Python developer.</p><p><strong>The for Keyword</strong></p><p>The for loop is by far the most popular loop in Python. It’s built by blending two Python keywords. They are for and in, as previously explained.</p><p><strong>The while Keyword</strong></p><p>Python’s while loop employs the term while and functions similarly to other computer languages’ while loops. The block after the while phrase will be repeated repeatedly until the condition following the while keyword is false.</p><p><strong>The break Keyword</strong></p><p>If you want to quickly break out of a loop, employ the break keyword. We can use this keyword in both for and while loops.</p><p><strong>The continue Keyword</strong></p><p>You can use the continue Python keyword if you wish to jump to the subsequent loop iteration. The continue keyword, as in many other computer languages, enables you to quit performing the present loop iteration and go on to the subsequent one.</p><p><strong>Code</strong></p><pre># Program to show the use of keywords for, while, break, continue  <br>for i in range(15):  <br>    <br>    print( i + 4, end = &quot; &quot;)  <br>        <br>    # breaking the loop when i = 9  <br>    if i == 9:  <br>        break     <br>print()  <br>        <br># looping from 1 to 15  <br>i = 0 # initial condition  <br>while i &lt; 15:  <br>        <br>    # When i has value 9, loop will jump to next iteration using continue. It will not print  <br>    if i == 9:  <br>        i += 3  <br>        continue  <br>    else:  <br>        # when i is not equal to 9, adding 2 and printing the value  <br>        print( i + 2, end = &quot; &quot;)  <br>            <br>    i += 1  </pre><p><strong>Output:</strong></p><pre>4 5 6 7 8 9 10 11 12 13 <br>2 3 4 5 6 7 8 9 10 14 15 16 </pre><h3>Exception Handling Keywords — try, except, raise, finally, and assert</h3><p><strong>try:</strong> This keyword is designed to handle exceptions and is used in conjunction with the keyword except to handle problems in the program. When there is some kind of error, the program inside the “try” block is verified, but the code in that block is not executed.</p><p><strong>except:</strong> As previously stated, this operates in conjunction with “try” to handle exceptions.</p><p><strong>finally:</strong> Whatever the outcome of the “try” section, the “finally” box is implemented every time.</p><p><strong>raise:</strong> The raise keyword could be used to specifically raise an exception.</p><p><strong>assert:</strong> This method is used to help in troubleshooting. Often used to ensure that code is correct. Nothing occurs if an expression is interpreted as true; however, if it is false, “AssertionError” is raised. An output with the error, followed by a comma, can also be printed.</p><p><strong>Code</strong></p><pre># initializing the numbers  <br>var1 = 4  <br>var2 = 0  <br>    <br># Exception raised in the try section  <br>try:  <br>    d = var1 // var2 # this will raise a &quot;divide by zero&quot; exception.  <br>    print( d )  <br># this section will handle exception raised in try block  <br>except ZeroDivisionError:  <br>    print(&quot;We cannot divide by zero&quot;)  <br>finally:  <br>    # If exception is raised or not, this block will be executed every time  <br>    print(&quot;This is inside finally block&quot;)  <br># by using assert keyword we will check if var2 is 0  <br>print (&quot;The value of var1 / var2 is : &quot;)  <br>assert var2 != 0, &quot;Divide by 0 error&quot;  <br>print (var1 / var2)  </pre><p><strong>Output:</strong></p><pre>We cannot divide by zero<br>This is inside finally block<br>The value of var1 / var2 is : <br>---------------------------------------------------------------------------<br>AssertionError                            Traceback (most recent call last)<br>Input In [44], in ()<br>     15 # by using assert keyword we will check if var2 is 0<br>     16 print (&quot;The value of var1 / var2 is : &quot;)<br>---&gt; 17 assert var2 != 0, &quot;Divide by 0 error&quot;<br>     18 print (var1 / var2)<br><br>AssertionError: Divide by 0 error</pre><h3>The pass Keyword</h3><p>In Python, a null sentence is called a pass. It serves as a stand-in for something else. When it is run, nothing occurs.</p><p>Let’s say we possess a function that has not been coded yet however we wish to do so in the long term. If we write just this in the middle of code,</p><p><strong>Code</strong></p><pre>def function_pass( arguments ):  </pre><p><strong>Output:</strong></p><pre>def function_pass( arguments ):<br>                                   ^<br>IndentationError: expected an indented block after function definition on line 1</pre><p>as shown, IndentationError will be thrown. Rather, we use the pass command to create a blank container.</p><p><strong>Code</strong></p><pre>def function_pass( arguments ):  <br>    pass  </pre><p>We can use the pass keyword to create an empty class too.</p><p><strong>Code</strong></p><pre>class passed_class:  <br>    pass  </pre><h3>The return Keyword</h3><p>The return expression is used to leave a function and generate a result.</p><p>The None keyword is returned by default if we don’t specifically return a value. The accompanying example demonstrates this.</p><p><strong>Code</strong></p><pre>def func_with_return():  <br>    var = 13  <br>    return var  <br>  <br>def func_with_no_return():  <br>    var = 10  <br>  <br>print( func_with_return() )  <br>print( func_with_no_return() )  </pre><p><strong>Output:</strong></p><pre>13<br>None</pre><h3>The del Keyword</h3><p>The del keyword is used to remove any reference to an object. In Python, every entity is an object. We can use the del command to remove a variable reference.</p><p><strong>Code</strong></p><pre>var1 = var2 = 5  <br>del var1  <br>print( var2 )  <br>print( var1 )  </pre><p><strong>Output:</strong></p><pre>5<br>---------------------------------------------------------------------------<br>NameError                                 Traceback (most recent call last)<br>Input In [42], in ()<br>      2 del var1<br>      3 print( var2 )<br>----&gt; 4 print( var1 )<br><br>NameError: name &#39;var1&#39; is not defined</pre><p>We can notice that the variable var1’s reference has been removed. As a result, it’s no longer recognized. However, var2 still exists.</p><p>Deleting entries from a collection like a list or a dictionary is also possible with del:</p><p><strong>Code</strong></p><pre>list_ = [&#39;A&#39;,&#39;B&#39;,&#39;C&#39;]  <br>del list_[2]  <br>print(list_)  </pre><p><strong>Output:</strong></p><pre>[&#39;A&#39;, &#39;B&#39;]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4edc6e3775b3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/python-tutorial-python-programming-language/python-keywords-python-tutorial-4edc6e3775b3">Python keywords — Python Tutorial</a> was originally published in <a href="https://medium.com/python-tutorial-python-programming-language">Python Tutorial | Python Programming Language</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Data Types — Python Tutorial]]></title>
            <link>https://medium.com/python-tutorial-python-programming-language/python-data-types-python-tutorial-560bfb8d992c?source=rss----d6d0bcd8c0fa---4</link>
            <guid isPermaLink="false">https://medium.com/p/560bfb8d992c</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[all-python-data-types]]></category>
            <category><![CDATA[python-data-types-sheet]]></category>
            <category><![CDATA[python-data-type]]></category>
            <dc:creator><![CDATA[Rajguleria]]></dc:creator>
            <pubDate>Fri, 13 Jan 2023 08:02:54 GMT</pubDate>
            <atom:updated>2023-01-13T08:02:54.051Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python Data Types — Python Tutorial</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vtaECRDYAew238Q_OIpYaQ.png" /><figcaption>python tutorial</figcaption></figure><p>Variables can hold values, and every value has a data type. Python is a dynamically typed language; hence, we do not need to define the type of the variable while declaring it. The interpreter implicitly binds the value to its type.</p><blockquote>a = 5</blockquote><p>The variable <strong>a</strong> holds an integer value of five, and we did not define its type. Python interpreter will automatically interpret variables <strong>a</strong> as an integer type.</p><p>Python enables us to check the type of the variable used in the program. Python provides us with the <strong>type()</strong> function, which returns the type of the variable passed.</p><p>Consider the following example to define the values of different data types and check their type:</p><pre>a=10  <br>b=&quot;Hi Python&quot;  <br>c = 10.5  <br>print(type(a))  <br>print(type(b))  <br>print(type(c))  </pre><p><strong>Output:</strong></p><pre>&lt;type &#39;int&#39;&gt;<br>&lt;type &#39;str&#39;&gt;<br>&lt;type &#39;float&#39;&gt;</pre><h3>Standard data types</h3><p>A variable can hold different types of values. For example, a person’s name must be stored as a string, whereas its id must be stored as an integer.</p><p>Python provides various standard data types that define the storage method for each of them. The data types defined in Python are given below.</p><ol><li><a href="https://www.javatpoint.com/python-data-types#numbers">Numbers</a></li><li><a href="https://www.javatpoint.com/python-data-types#SequenceType">Sequence Type</a></li><li><a href="https://www.javatpoint.com/python-data-types#Boolean">Boolean</a></li><li><a href="https://www.javatpoint.com/python-data-types#Set">Set</a></li><li><a href="https://www.javatpoint.com/python-data-types#dictionary">Dictionary</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*hl9M9U_wnIFwdai8.png" /></figure><p>In this section of the tutorial, we will give a brief introduction to the above data types. We will discuss each one of them in detail later in this tutorial.</p><h3>Numbers</h3><p>A number stores numeric values. The integer, float, and complex values belong to the Python Numbers data type. Python provides the <strong>type()</strong> function to know the data-type of the variable. Similarly, the <strong>isinstance()</strong> function is used to check whether an object belongs to a particular class.</p><p>Python creates Number objects when a number is assigned to a variable. For example;</p><pre>a = 5  <br>print(&quot;The type of a&quot;, type(a))  <br>  <br>b = 40.5  <br>print(&quot;The type of b&quot;, type(b))  <br>  <br>c = 1+3j  <br>print(&quot;The type of c&quot;, type(c))  <br>print(&quot; c is a complex number&quot;, isinstance(1+3j,complex))  </pre><p><strong>Output:</strong></p><pre>The type of a &lt;class &#39;int&#39;&gt;<br>The type of b &lt;class &#39;float&#39;&gt;<br>The type of c &lt;class &#39;complex&#39;&gt;<br>c is complex number: True</pre><p>Python supports three types of numeric data.</p><ol><li><strong>Int </strong>— Integer value can be any length such as integers 10, 2, 29, -20, -150 etc. Python has no restriction on the length of an integer. Its value belongs to <strong>int</strong></li><li><strong>Float </strong>— Float is used to store floating-point numbers like 1.9, 9.902, 15.2, etc. It is accurate upto 15 decimal points.</li><li><strong>complex </strong>— A complex number contains an ordered pair, i.e.., x + iy where x and y denote the real and imaginary parts, respectively. The complex numbers like 2.14j, 2.0 + 2.3j, etc.</li></ol><h3>Sequence Type</h3><h3>String</h3><p>The string can be defined as the sequence of characters represented in the quotation marks. In Python, we can use single, double, or triple quotes to define a string.</p><p>String handling in Python is a straightforward task since Python provides built-in functions and operators to perform operations on the string.</p><p>In the case of string handling, the operator + is used to concatenate two strings, as the operation <em>“hello&quot; + &quot;python”</em> returns <em>“hello python”</em>.</p><p>The operator * is known as a repetition operator, as the operation “Python” *2 returns &quot;Python Python.&quot;</p><p>The following example illustrates the string in Python.</p><p><strong>Example — 1</strong></p><pre>str = &quot;string using double quotes&quot;  <br>print(str)  <br>s = &#39;&#39;&#39;&#39;&#39;A multiline <br>string&#39;&#39;&#39;  <br>print(s)  </pre><p><strong>Output:</strong></p><pre>string using double quotes<br>A multiline<br>string</pre><p>Consider the following example of string handling:</p><p><strong>Example — 2</strong></p><pre>str1 = &#39;hello javatpoint&#39; #string str1    <br>str2 = &#39; how are you&#39; #string str2    <br>print (str1[0:2]) #printing first two character using slice operator    <br>print (str1[4]) #printing 4th character of the string    <br>print (str1*2) #printing the string twice    <br>print (str1 + str2) #printing the concatenation of str1 and str2    </pre><p><strong>Output:</strong></p><pre>he<br>o<br>hello javatpointhello javatpoint<br>hello javatpoint how are you</pre><h3>List</h3><p>Python lists are similar to arrays in C. However, the list can contain data of different types. The items stored in the list are separated with a comma (,) and enclosed within square brackets [].</p><p>We can use slice [:] operators to access the data of the list. The concatenation operator (+) and repetition operator (*) work with the list in the same way they worked with the strings.</p><p>Consider the following example:</p><pre>list1  = [1, &quot;hi&quot;, &quot;Python&quot;, 2]    <br>#Checking type of given list  <br>print(type(list1))  <br>  <br>#Printing the list1  <br>print (list1)  <br>  <br># List slicing  <br>print (list1[3:])  <br>  <br># List slicing  <br>print (list1[0:2])   <br>  <br># List Concatenation using + operator  <br>print (list1 + list1)  <br>  <br># List repetation using * operator  <br>print (list1 * 3)  </pre><p><strong>Output:</strong></p><pre>[1, &#39;hi&#39;, &#39;Python&#39;, 2]<br>[2]<br>[1, &#39;hi&#39;]<br>[1, &#39;hi&#39;, &#39;Python&#39;, 2, 1, &#39;hi&#39;, &#39;Python&#39;, 2]<br>[1, &#39;hi&#39;, &#39;Python&#39;, 2, 1, &#39;hi&#39;, &#39;Python&#39;, 2, 1, &#39;hi&#39;, &#39;Python&#39;, 2]</pre><h3>Tuple</h3><p>Tuples are similar to the list in many ways. Like lists, tuples also contain a collection of items of different data types. The items of the tuple are separated by a comma (,) and enclosed in parentheses ().</p><p>A tuple is a read-only data structure, as we can’t modify the size and value of the items in it.</p><p>Let’s see a simple example of the tuple.</p><pre>tup  = (&quot;hi&quot;, &quot;Python&quot;, 2)    <br># Checking type of tup  <br>print (type(tup))    <br>  <br>#Printing the tuple  <br>print (tup)  <br>  <br># Tuple slicing  <br>print (tup[1:])    <br>print (tup[0:1])    <br>  <br># Tuple concatenation using + operator  <br>print (tup + tup)    <br>  <br># Tuple repatation using * operator  <br>print (tup * 3)     <br>  <br># Adding value to tup. It will throw an error.  <br>t[2] = &quot;hi&quot;  </pre><p><strong>Output:</strong></p><pre>&lt;class &#39;tuple&#39;&gt;<br>(&#39;hi&#39;, &#39;Python&#39;, 2)<br>(&#39;Python&#39;, 2)<br>(&#39;hi&#39;,)<br>(&#39;hi&#39;, &#39;Python&#39;, 2, &#39;hi&#39;, &#39;Python&#39;, 2)<br>(&#39;hi&#39;, &#39;Python&#39;, 2, &#39;hi&#39;, &#39;Python&#39;, 2, &#39;hi&#39;, &#39;Python&#39;, 2)<br><br>Traceback (most recent call last):<br>  File &quot;main.py&quot;, line 14, in &lt;module&gt;<br>    t[2] = &quot;hi&quot;;<br>TypeError: &#39;tuple&#39; object does not support item assignment</pre><h3>Dictionary</h3><p>Dictionary is an unordered set of a key-value pair of items. It is like an associative array or a hash table where each key stores a specific value. Key can hold any primitive data type, whereas value is an arbitrary Python object.</p><p>The items in the dictionary are separated with the comma (,) and enclosed in curly braces ().</p><p>Consider the following example:</p><pre>d = {1:&#39;Jimmy&#39;, 2:&#39;Alex&#39;, 3:&#39;john&#39;, 4:&#39;mike&#39;}     <br>  <br># Printing dictionary  <br>print (d)  <br>  <br># Accesing value using keys  <br>print(&quot;1st name is &quot;+d[1])   <br>print(&quot;2nd name is &quot;+ d[4])    <br>  <br>print (d.keys())    <br>print (d.values())    </pre><p><strong>Output:</strong></p><pre>1st name is Jimmy<br>2nd name is mike<br>{1: &#39;Jimmy&#39;, 2: &#39;Alex&#39;, 3: &#39;john&#39;, 4: &#39;mike&#39;}<br>dict_keys([1, 2, 3, 4])<br>dict_values([&#39;Jimmy&#39;, &#39;Alex&#39;, &#39;john&#39;, &#39;mike&#39;])</pre><h3>Boolean</h3><p>The Boolean type provides two built-in values: true and false. These values are used to determine whether the given statement is true or false. It is denoted by the class bool. True can be represented by any non-zero value or ‘T’ whereas false can be represented by the 0 or ‘F’. Consider the following example:</p><pre># Python program to check the boolean type  <br>print(type(True))  <br>print(type(False))  <br>print(false)  </pre><p><strong>Output:</strong></p><pre>&lt;class &#39;bool&#39;&gt;<br>&lt;class &#39;bool&#39;&gt;<br>NameError: name &#39;false&#39; is not defined</pre><h3>Set</h3><p>Python Set is the unordered collection of the data type. It is iterable, mutable (it can be modified after creation), and has unique elements. In set, the order of the elements is undefined; it may return the changed sequence of the element. The set is created by using the built-in function <strong>set(),</strong> or a sequence of elements is passed in the curly braces and separated by the comma. It can contain various types of values. Consider the following example:</p><pre># Creating Empty set  <br>set1 = set()  <br>  <br>set2 = {&#39;James&#39;, 2, 3,&#39;Python&#39;}  <br>  <br>#Printing Set value  <br>print(set2)  <br>  <br># Adding element to the set  <br>  <br>set2.add(10)  <br>print(set2)  <br>  <br>#Removing element from the set  <br>set2.remove(2)  <br>print(set2)  </pre><p><strong>Output:</strong></p><pre>{3, &#39;Python&#39;, &#39;James&#39;, 2}<br>{&#39;Python&#39;, &#39;James&#39;, 3, 2, 10}<br>{&#39;Python&#39;, &#39;James&#39;, 3, 10}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=560bfb8d992c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/python-tutorial-python-programming-language/python-data-types-python-tutorial-560bfb8d992c">Python Data Types — Python Tutorial</a> was originally published in <a href="https://medium.com/python-tutorial-python-programming-language">Python Tutorial | Python Programming Language</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python variables — Python Tutorial]]></title>
            <link>https://medium.com/python-tutorial-python-programming-language/python-variables-python-tutorial-1da046e75188?source=rss----d6d0bcd8c0fa---4</link>
            <guid isPermaLink="false">https://medium.com/p/1da046e75188</guid>
            <category><![CDATA[python-variable]]></category>
            <category><![CDATA[declare-variables-python]]></category>
            <category><![CDATA[python-variables-strings]]></category>
            <category><![CDATA[multiply-variables-python]]></category>
            <category><![CDATA[print-variables-in-python]]></category>
            <dc:creator><![CDATA[Rajguleria]]></dc:creator>
            <pubDate>Fri, 13 Jan 2023 07:43:07 GMT</pubDate>
            <atom:updated>2023-01-13T07:43:07.790Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python variables — Python Tutorial</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3MRCo1uq0uvYpkwwRTyJdg.jpeg" /></figure><p>Variable is a name that is used to refer to memory location. Python variable is also known as an identifier and used to hold value.</p><p>In Python, we don’t need to specify the type of variable because Python is a infer language and smart enough to get variable type.</p><p>Variable names can be a group of both letters and digits, but they have to begin with a letter or an underscore.</p><p>It is recommended to use lowercase letters for the variable name. Rahul and Rahul both are two different variables.</p><h3>Identifier Naming</h3><p>Variables are example of identifiers. An Identifier is used to identify the literals used in the program. The rules to name an identifier are given below.</p><ul><li>The first character of the variable must be an alphabet or underscore ( _ ).</li><li>All the characters except the first character may be an alphabet of lower-case(a-z), upper-case (A-Z), underscore, or digit (0–9).</li><li>The identifier name must not contain any white space, or special character (! @, #, %, ^, &amp;, *).</li><li>The identifier name must not be similar to any keyword defined in the language.</li><li>Identifier names are case sensitive; for example, my name, and my name is not the same.</li><li>Examples of valid identifiers: are a123, _n, n_9, etc.</li><li>Examples of invalid identifiers: 1a, n%4, n 9, etc.</li></ul><h3>Declaring Variable and Assigning Values</h3><p>Python does not bind us to declare a variable before using it in the application. It allows us to create a variable at the required time.</p><p>We don’t need to declare explicitly variables in Python. When we assign any value to the variable, that variable is declared automatically.</p><p>The equal (=) operator is used to assign value to a variable.</p><h3>Object References</h3><p>It is necessary to understand how the Python interpreter works when we declare a variable. The process of treating variables is somewhat different from many other programming languages.</p><p>Python is a highly object-oriented programming language; that’s why every data item belongs to a specific type of class. Consider the following example.</p><pre>print(&quot;John&quot;)  </pre><p><strong>Output:</strong></p><pre>John</pre><p>The Python object creates an integer object and displays it on the console. In the above print statement, we have created a string object. Let’s check the type of it using the built-in <strong>type()</strong> function in Python.</p><pre>type(&quot;John&quot;)  </pre><p><strong>Output:</strong></p><pre>&lt;class &#39;str&#39;&gt;</pre><p>In Python, variables have a symbolic name that is a reference or pointer to an object. The variables are used to denote objects by that name.</p><p>Let’s understand the following example</p><blockquote>a = 50</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/0*pHDAORLqc3lmROK3.png" /></figure><p>In the above image, the variable <strong>a</strong> refers to an integer object.</p><p>Suppose we assign the integer value 50 to a new variable b.</p><blockquote>a = 50</blockquote><blockquote>b = a</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/0*V7sr183hrQxnDi8m.png" /></figure><p>The variable b refers to the same object that points to because Python does not create another object.</p><p>Let’s assign the new value to b. Now both variables will refer to the different objects.</p><blockquote>a = 50</blockquote><blockquote>b =100</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/0*3G7JPm5ZKJGATib2.png" /></figure><p>Python manages memory efficiently if we assign the same variable to two different values.</p><h3>Object Identity</h3><p>In Python, every created object identifies uniquely. Python provides the guarantee that no two objects will have the same identifier. The built-in <strong>id()</strong> function, is used to identify the object identifier. Consider the following example.</p><pre>a = 50  <br>b = a  <br>print(id(a))  <br>print(id(b))  <br># Reassigned variable a  <br>a = 500  <br>print(id(a))  </pre><p><strong>Output:</strong></p><pre>140734982691168<br>140734982691168<br>2822056960944</pre><p>We assigned the <strong>b = a, a,</strong> and <strong>b</strong> both point to the same object. When we checked by the <strong>id()</strong> function it returned the same number. We reassign <strong>a</strong> to 500; then it referred to the new object identifier.</p><h3>Variable Names</h3><p>We have already discussed how to declare the valid variable. Variable names can be any length and can have uppercase, lowercase (A to Z, a to z), the digit (0–9), and underscore character(_). Consider the following example of valid variable names.</p><pre>name = &quot;Devansh&quot;  <br>age = 20  <br>marks = 80.50  <br>  <br>print(name)  <br>print(age)  <br>print(marks)  </pre><p><strong>Output:</strong></p><pre>Devansh<br>20<br>80.5</pre><p>Consider the following valid variables&#39; name.</p><pre>name = &quot;A&quot;  <br>Name = &quot;B&quot;  <br>naMe = &quot;C&quot;  <br>NAME = &quot;D&quot;  <br>n_a_m_e = &quot;E&quot;  <br>_name = &quot;F&quot;  <br>name_ = &quot;G&quot;  <br>_name_ = &quot;H&quot;  <br>na56me = &quot;I&quot;  <br>  <br>print(name,Name,naMe,NAME,n_a_m_e, NAME, n_a_m_e, _name, name_,_name, na56me)  </pre><p><strong>Output:</strong></p><pre>A B C D E D E F G F I</pre><p>In the above example, we have declared a few valid variable names such as name, _name_, etc. But it is not recommended because when we try to read code, it may create confusion. The variable name should be descriptive to make the code more readable.</p><p>The multi-word keywords can be created by the following method.</p><ul><li><strong>Camel Case </strong>— In the camel case, each word or abbreviation in the middle begins with a capital letter. There is no intervention of whitespace. For example — name of student, valueOfVaraible, etc.</li><li><strong>Pascal Case </strong>— It is the same as the Camel Case, but here the first word is also capitalized. For example — NameOfStudent, etc.</li><li><strong>Snake Case </strong>— In the snake case, Words are separated by the underscore. For example — name_of_student, etc.</li></ul><h3>Multiple Assignment</h3><p>Python allows us to assign a value to multiple variables in a single statement, which is also known as multiple assignments.</p><p>We can apply multiple assignments in two ways, either by assigning a single value to multiple variables or assigning multiple values to multiple variables. Consider the following example.</p><ol><li><strong>Assigning a single value to multiple variables Eg:</strong></li></ol><pre>x=y=z=50    <br>print(x)    <br>print(y)    <br>print(z)    </pre><p><strong>Output:</strong></p><pre>50  <br>50  <br>50 </pre><ol><li><strong>2. Assigning multiple values to multiple variables Eg:</strong></li></ol><pre>a,b,c=5,10,15    <br>print a    <br>print b    <br>print c    </pre><p><strong>Output:</strong></p><pre>5  <br>10  <br>15  </pre><p>The values will be assigned in the order in which variables appear.</p><h3>Python Variable Types</h3><p>There are two types of variables in Python — Local variables and Global variables. Let’s understand the following variables.</p><h3>Local Variable</h3><p>Local variables are the variables that are declared inside the function and have scope within the function. Let’s understand the following example.</p><p><strong>Example -</strong></p><pre># Declaring a function  <br>def add():  <br>    # Defining local variables. They has scope only within a function  <br>    a = 20  <br>    b = 30  <br>    c = a + b  <br>    print(&quot;The sum is:&quot;, c)  <br>  <br># Calling a function  <br>add()  </pre><p><strong>Output:</strong></p><pre>The sum is: 50</pre><p><strong>Explanation:</strong></p><p>In the above code, we declared a function named <strong>add()</strong> and assigned a few variables within the function. These variables will be referred to as the <strong>local variables</strong> which have scope only inside the function. If we try to use them outside the function, we get the following error.</p><pre>add()  <br># Accessing local variable outside the function   <br>print(a)  </pre><p><strong>Output:</strong></p><pre>The sum is: 50<br>    print(a)<br>NameError: name &#39;a&#39; is not defined</pre><p>We tried to use a local variable outside their scope; it threw the <strong>NameError.</strong></p><h3>Global Variables</h3><p>Global variables can be used throughout the program, and its scope is in the entire program. We can use global variables inside or outside the function.</p><p>A variable declared outside the function is the global variable by default. Python provides the <strong>global</strong> keyword to use the global variables inside the function. If we don’t use the <strong>global</strong> keyword, the function treats it as a local variable. Let’s understand the following example.</p><p><strong>Example -</strong></p><pre># Declare a variable and initialize it  <br>x = 101  <br>  <br># Global variable in function  <br>def mainFunction():  <br>    # printing a global variable  <br>    global x  <br>    print(x)  <br>    # modifying a global variable  <br>    x = &#39;Welcome To Javatpoint&#39;  <br>    print(x)  <br>  <br>mainFunction()  <br>print(x)  </pre><p><strong>Output:</strong></p><pre>101<br>Welcome To Javatpoint<br>Welcome To Javatpoint</pre><p><strong>Explanation:</strong></p><p>In the above code, we declare a global variable <strong>x</strong> and assign a value to it. Next, we defined a function and accessed the declared variable using the <strong>global</strong> keyword inside the function. Now we can modify its value. Then, we assigned a new string value to the variable x.</p><p>Now, we called the function and proceeded to print <strong>x</strong>. It printed the as newly assigned value of x.</p><h3>Delete a variable</h3><p>We can delete the variable using the <strong>del</strong> keyword. The syntax is given below.</p><p><strong>Syntax -</strong></p><pre>del &lt;variable_name&gt;<br></pre><p>In the following example, we create a variable x and assign a value to it. We deleted variable x, and print it, we get the error <strong>“variable x is not defined”</strong>. The variable x will no longer use in the future.</p><p><strong>Example -</strong></p><pre># Assigning a value to x  <br>x = 6  <br>print(x)  <br># deleting a variable.   <br>del x  <br>print(x)  </pre><p><strong>Output:</strong></p><pre>6<br>Traceback (most recent call last):<br>  File &quot;C:/Users/DEVANSH SHARMA/PycharmProjects/Hello/multiprocessing.py&quot;, line 389, in <br>    print(x)<br>NameError: name &#39;x&#39; is not defined</pre><h3>Maximum Possible Value of an Integer in Python</h3><p>Unlike the other programming languages, Python doesn’t have long int or float data types. It treats all integer values as an <strong>int</strong> data type. Here, the question arises. What is the maximum possible value that can hold by the variable in Python? Consider the following example.</p><p><strong>Example -</strong></p><pre># A Python program to display that we can store  <br># large numbers in Python  <br>  <br>a = 10000000000000000000000000000000000000000000  <br>a = a + 1  <br>print(type(a))  <br>print (a)  </pre><p><strong>Output:</strong></p><pre>&lt;class &#39;int&#39;&gt;<br>10000000000000000000000000000000000000000001</pre><p>As we can see in the above example, we assigned a large integer value to variable <strong>x</strong> and checked its type. It printed <strong>class &lt;int&gt;</strong> not long int. Hence, there is no limitation number by bits and we can expand to the limit of our memory.</p><p>Python doesn’t have any special data type to store larger numbers.</p><h3>Print Single and Multiple Variables in Python</h3><p>We can print multiple variables within the single print statement. Below are example of single and multiple printing values.</p><p><strong>Example — 1 (Printing Single Variable)</strong></p><pre># printing single value   <br>a = 5  <br>print(a)  <br>print((a)) </pre><p><strong>Output:</strong></p><pre>5<br>5</pre><p><strong>Example — 2 (Printing Multiple Variables)</strong></p><pre>a = 5  <br>b = 6  <br># printing multiple variables  <br>print(a,b)  <br># separate the variables by the comma  <br>Print(1, 2, 3, 4, 5, 6, 7, 8)   </pre><p><strong>Output:</strong></p><pre>5 6<br>1 2 3 4 5 6 7 8</pre><h3>Basic Fundamentals:</h3><p>This section contains the fundamentals of Python, such as:</p><p><strong>I) Tokens and their types.</strong></p><p><strong>ii) Comments</strong></p><p><strong>a) Tokens:</strong></p><ul><li>The tokens can be defined as a punctuator mark, reserved words, and each word in a statement.</li><li>The token is the smallest unit inside the given program.</li></ul><p>There are the following tokens in Python:</p><ul><li>Keywords.</li><li>Identifiers.</li><li>Literals.</li><li>Operators.</li></ul><p>We will discuss above the tokens in detail next tutorials.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1da046e75188" width="1" height="1" alt=""><hr><p><a href="https://medium.com/python-tutorial-python-programming-language/python-variables-python-tutorial-1da046e75188">Python variables — Python Tutorial</a> was originally published in <a href="https://medium.com/python-tutorial-python-programming-language">Python Tutorial | Python Programming Language</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to install python — python tutorial]]></title>
            <link>https://medium.com/python-tutorial-python-programming-language/how-to-install-python-python-tutorial-9c56830100a8?source=rss----d6d0bcd8c0fa---4</link>
            <guid isPermaLink="false">https://medium.com/p/9c56830100a8</guid>
            <category><![CDATA[install-python]]></category>
            <category><![CDATA[install-python-on-mac]]></category>
            <category><![CDATA[install-python-on-centos]]></category>
            <category><![CDATA[install-python-on-ubuntu]]></category>
            <category><![CDATA[install-python-mac]]></category>
            <dc:creator><![CDATA[Rajguleria]]></dc:creator>
            <pubDate>Fri, 13 Jan 2023 07:18:39 GMT</pubDate>
            <atom:updated>2023-01-13T07:18:38.852Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to install python — Python Tutorial</h3><p>In order to become a Python developer, the first step is to learn how to install or update Python on a local machine or computer. In this tutorial, we will discuss the installation of Python on various operating systems.</p><h3>Installation on Windows</h3><p>Visit the link <a href="https://www.python.org/downloads/"><em>https://www.python.org/downloads/</em></a> to download the latest release of <a href="https://www.javatpoint.com/python-tutorial">Python</a>. In this process, we will install Python 3.8.6 on our <a href="https://www.javatpoint.com/windows">Windows operating system</a>. When we click on the above link, it will bring us to the following page.</p><p><strong>Step 1: Select the Python version to download.</strong></p><p>Click on the download button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/0*xlT4QJmRt6b_E4-a.png" /></figure><p><strong>Step — 2: Click on the Install Now</strong></p><p>Double-click the executable file, which has been downloaded; the following window will open. Select &quot;Customize installation&quot; and proceed. Click on the Add Path check box; it will set the Python path automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/0*2Qw69-7uc6dcdpYV.png" /></figure><p>We can also click on &quot;customize installation&quot; to choose the desired location and features. Other important thing is install launcher for the all user must be checked.</p><p><strong>Step — 3 Installation in Process</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/0*yfYvmb0Wg7NqaaM6.png" /></figure><p>Now, try to run Python on the command prompt. Type the command &quot;python --version&quot; in the case of Python 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/0*cChF8zbr7UFq8UHW.png" /></figure><p>We are ready to work with Python.</p><h3>How to Installation on Mac ?</h3><p>To install Python 3 on MacOS, visit the link <a href="https://medium.com/python-tutorial-python-programming-language/how-to-install-python-on-mac-python-tutorial-f325c51dc6f7">https://medium.com/python-tutorial-python-programming-language/how-to-install-python-on-mac-python-tutorial-f325c51dc6f7</a> and follow the instructions given in the tutorial.</p><h3>How Installation on CentOS ?</h3><p>To install Python3 on CentOS, visit the link <a href="https://medium.com/python-tutorial-python-programming-language/how-to-install-python-on-centos-python-tutorial-35d257cf5b89">https://medium.com/python-tutorial-python-programming-language/how-to-install-python-on-centos-python-tutorial-35d257cf5b89</a> and follow the instructions given in the tutorial.</p><h3>How to Installation on Ubuntu ?</h3><p>To install Python3 on Ubuntu, visit the link <a href="https://medium.com/python-tutorial-python-programming-language/how-to-install-python-in-ubuntu-python-tutorial-640561c3cc5b">https://medium.com/python-tutorial-python-programming-language/how-to-install-python-in-ubuntu-python-tutorial-640561c3cc5b</a> and follow the instructions given in the tutorial.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c56830100a8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/python-tutorial-python-programming-language/how-to-install-python-python-tutorial-9c56830100a8">How to install python — python tutorial</a> was originally published in <a href="https://medium.com/python-tutorial-python-programming-language">Python Tutorial | Python Programming Language</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Install Python on Mac — Python Tutorial]]></title>
            <link>https://medium.com/python-tutorial-python-programming-language/how-to-install-python-on-mac-python-tutorial-f325c51dc6f7?source=rss----d6d0bcd8c0fa---4</link>
            <guid isPermaLink="false">https://medium.com/p/f325c51dc6f7</guid>
            <category><![CDATA[install-python-on-mac]]></category>
            <category><![CDATA[install-python-3-on-mac]]></category>
            <category><![CDATA[how-to-install-python-mac]]></category>
            <dc:creator><![CDATA[Rajguleria]]></dc:creator>
            <pubDate>Fri, 13 Jan 2023 07:14:00 GMT</pubDate>
            <atom:updated>2023-01-13T07:14:00.475Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Install Python on Mac — Python Tutorial</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XrsvwFSDIqxRlqd8OhDI5A.jpeg" /></figure><h3>Introduction</h3><p>Python is a high-level, dynamic, general-purpose language. It was developed by <strong>Guido Van Rossum</strong> in <strong>1991</strong>. Python’s syntax allows developers to use fewer lines of code than any other programming language. It basically focuses on the code readability of program. Python 2.7 is installed by default on MacOS but we can install other versions like python 3.5 and 3.6.</p><p>In this tutorial, we are learning how to install Python 3.6.3 on the MAC Operating system.</p><h3>Prerequisites</h3><ul><li>MacOS</li><li>Login as an administrator on terminal</li></ul><h3>Installation</h3><p>There are following steps which are used while installing Python3 on MacOS.</p><p>1) <strong>Checking python’s version on the system</strong></p><p>We can check which version of the Python is currently installed on our system. Generally, Python 2.7 is installed by default.</p><p>Let’s see how can we do it.</p><pre>$ python -version   </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/0*XHGc5DgfJ2sgDeIq.png" /></figure><p>It shows <strong>Python 2.7.10</strong> is installed on the computer, which happens quite often.</p><p>2) <strong>Download Python 3.6.3</strong></p><p>In order to install Python 3.6.3, we must download the latest version from its official website, <a href="https://www.python.org/downloads/">https://www.python.org/downloads/</a> . The file is downloaded in <strong>.pkg</strong> format which can be directly installed by using <strong>Installer</strong> command.</p><p>3) <strong>Install Python 3.6.3</strong></p><p>Since the downloaded file is already in.pkg format, no mounting is required, and we can use the installer command to install Python 3.6.3.</p><p>Let’s see how we can do it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/0*0P3LcC9Ke3NBtGoG.png" /></figure><p>Since The installer is used with super user permissions hence <strong>sudo</strong> forces terminal to prompt the user to fill the admin password. The process installs Python 3.6.3 to the root directory, which is mentioned with the target option.</p><p>4) <strong>Verify Python3</strong></p><p>To check which Python version is installed on the machine, we can use the <strong>python --version</strong> command. Since the default installed version is Python 2.7.10, it shows Python 2.7.10. but it gives us flexibility to check the version of Python 3 on our computer.</p><p>Let’s see how we can use Python 3 to check which version of Python 3 is running.</p><pre>$ python -version  </pre><p>5) <strong>Working on Python’s script mode</strong></p><p>To work on the Python command line, we simply type <strong>python3 on the terminal. Python shell open where we can run Python statements such as print statements as we did here.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/0*mm6ivhMpA_tB4pEZ.png" /></figure><p>To run a Python file <strong>(.py)</strong> on the terminal, we simply type the file name, and the file will be interpreted.</p><p>Well, we have installed Python3 on our MacOS.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f325c51dc6f7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/python-tutorial-python-programming-language/how-to-install-python-on-mac-python-tutorial-f325c51dc6f7">How to Install Python on Mac — Python Tutorial</a> was originally published in <a href="https://medium.com/python-tutorial-python-programming-language">Python Tutorial | Python Programming Language</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Install Python on CentOS — Python Tutorial]]></title>
            <link>https://medium.com/python-tutorial-python-programming-language/how-to-install-python-on-centos-python-tutorial-35d257cf5b89?source=rss----d6d0bcd8c0fa---4</link>
            <guid isPermaLink="false">https://medium.com/p/35d257cf5b89</guid>
            <category><![CDATA[install-python-on-centos]]></category>
            <category><![CDATA[install-python]]></category>
            <category><![CDATA[install-python-centos-7]]></category>
            <dc:creator><![CDATA[Rajguleria]]></dc:creator>
            <pubDate>Fri, 13 Jan 2023 07:06:23 GMT</pubDate>
            <atom:updated>2023-01-13T07:06:23.010Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Install Python on CentOS — Python Tutorial</h3><h3>Introduction</h3><p>Python is a high-level, dynamic, general-purpose language. It was developed by <strong>Guido Van Rossum</strong> in <strong>1991</strong>. Python’s syntax allows developers to use fewer lines of code than any other programming language. It basically focuses on the code readability of programs. Python 2.7 is installed by default on CentOS, but we can install other versions like Python 3.5 and 3.6. In this tutorial, we are learning how to install Python 3.6.3 on CentOS.</p><h3>Prerequisites</h3><ul><li>CentOS</li><li>Log in as an administrator on the terminal</li><li>Yum must be configured on the system.</li></ul><h3>Installation</h3><h3>Installation includes the following steps:</h3><p>1. <strong>Install IUS Community Repository</strong></p><p>In order to install Python 3.6 on CentOS, we first need to install the IUS community repository, which provides extra packages for Enterprise Linux. Execute the following command to install the IUS community repository:</p><pre>$ sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm   </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/0*-ERurucjlCEJrdS0.png" /></figure><p>2. <strong>Install Python 3</strong></p><p>Execute the following command to install Python 3.6 on CentOS:</p><pre>$ sudo yum install python36u   </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/0*ZgirDHJP0Cx2vR_O.png" /></figure><p>3. <strong>Verify Python</strong></p><p>To verify if we have installed the correct version of Python, we just need to type python 3.6<strong> -V</strong> on the terminal. The command will show the version installed, which is 3.6.4 in my case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/0*2bSE9kEFz5LRx76F.png" /></figure><p>4. <strong>Working on Python’s script mode</strong></p><p>Just type python3.6 on the terminal to enter Python’s script mode. We can execute the Python statements on this shell. Since Python 2 is by default installed on CentOS, typing python on the terminal takes us to the Python 2 shell, so we have to type python3.6 to work on the desired Python shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/0*cT8mS9Bku1Bk-ciI.png" /></figure><p>Execute the valid Python statements, which get interpreted and show the desired output on the terminal as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/0*-F-FUs3uWCCDXo7W.png" /></figure><p>Hence, we have installed and can get started with Python 3.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35d257cf5b89" width="1" height="1" alt=""><hr><p><a href="https://medium.com/python-tutorial-python-programming-language/how-to-install-python-on-centos-python-tutorial-35d257cf5b89">How to Install Python on CentOS — Python Tutorial</a> was originally published in <a href="https://medium.com/python-tutorial-python-programming-language">Python Tutorial | Python Programming Language</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Install Python in Ubuntu — Python Tutorial]]></title>
            <link>https://medium.com/python-tutorial-python-programming-language/how-to-install-python-in-ubuntu-python-tutorial-640561c3cc5b?source=rss----d6d0bcd8c0fa---4</link>
            <guid isPermaLink="false">https://medium.com/p/640561c3cc5b</guid>
            <category><![CDATA[download-python-on-ubuntu]]></category>
            <category><![CDATA[python-on-ubuntu]]></category>
            <category><![CDATA[update-python-on-ubuntu]]></category>
            <category><![CDATA[install-python-on-ubuntu]]></category>
            <category><![CDATA[upgrade-python-on-ubuntu]]></category>
            <dc:creator><![CDATA[Rajguleria]]></dc:creator>
            <pubDate>Fri, 13 Jan 2023 07:00:26 GMT</pubDate>
            <atom:updated>2023-01-13T07:00:26.603Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Install Python in Ubuntu — Python Tutorial</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vtaECRDYAew238Q_OIpYaQ.png" /></figure><h3>Introduction</h3><p>Python is a high-level, dynamic, and general-purpose programming language. It was designed and developed by the Python Software Foundation.</p><p>Python is a cross-platform language and was first released on February 20, 1991.</p><p>In this tutorial, we are working on the installation process of Python, which includes the following steps:</p><p>Although Python 2.7 is installed by default in Ubuntu, we can install other Python versions, like Python 3.</p><p>To install Python 3, just type the following command in the terminal, and it will be installed automatically.</p><h3>Python Installation</h3><ol><li><strong>Update the APT Repository</strong></li></ol><pre>$ apt-get update</pre><p>2) <strong>Install Python</strong></p><pre>$ apt-get install python3.6  </pre><p>3) <strong>Verify Python</strong></p><pre>$ python  </pre><p>When we type <strong>Python,</strong> it shows the default installed Python, which is 2.7.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/0*fhxOPpxpU2n35cLa.png" /></figure><p>For Python 3, type the following command, and it will show the other version as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/0*pG5xzNbmdzkDTCaU.png" /></figure><p>Well, on the basis of these commands, we can test applications for both Python versions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=640561c3cc5b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/python-tutorial-python-programming-language/how-to-install-python-in-ubuntu-python-tutorial-640561c3cc5b">How to Install Python in Ubuntu — Python Tutorial</a> was originally published in <a href="https://medium.com/python-tutorial-python-programming-language">Python Tutorial | Python Programming Language</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Applications — python tutorial]]></title>
            <link>https://medium.com/python-tutorial-python-programming-language/python-applications-python-tutorial-33498430938a?source=rss----d6d0bcd8c0fa---4</link>
            <guid isPermaLink="false">https://medium.com/p/33498430938a</guid>
            <category><![CDATA[python-web-developer]]></category>
            <category><![CDATA[python-flask]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[applications-python]]></category>
            <category><![CDATA[python-app]]></category>
            <dc:creator><![CDATA[Rajguleria]]></dc:creator>
            <pubDate>Thu, 12 Jan 2023 15:20:34 GMT</pubDate>
            <atom:updated>2023-01-12T15:20:34.822Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python Applications — python tutorial</h3><p>Python is known for its general-purpose nature, which makes it applicable in almost every domain of software development. Python makes its presence felt in every emerging field. It is the fastest-growing programming language and can develop any application.</p><p>Here, we are specifying application areas where Python can be applied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*Lhg71nP8rYyLaZvs.png" /></figure><h3>1) Web Applications</h3><p>We can use Python to develop web applications. It provides libraries to handle internet protocols such as HTML and XML, JSON, Email processing, request, beautifulSoup, Feedparser, etc. One of Python web-framework named Django is used on <strong>Instagram</strong>. Python provides many useful frameworks, and these are given below:</p><ul><li>Django and Pyramid framework(Use for heavy applications)</li><li>Flask and Bottle (Micro-framework)</li><li>Plone and Django CMS (Advance Content management)</li></ul><h3>2) Desktop GUI Applications</h3><p>The GUI stands for &quot;Graphical User Interface,&quot; which provides smooth interaction with any application. Python provides a <strong>Tk GUI library</strong> to develop a user interface. Some popular GUI libraries are given below.</p><ul><li>Tkinter or Tk</li><li>wxWidgetM</li><li>Kivy (used for writing multitouch applications )</li><li>PyQt or Pyside</li></ul><h3>3) Console-based Application</h3><p>Console-based applications run from the command line, or shell. These applications are computer programs that execute commands. This kind of application was more popular in the old generation of computers. Python can develop this kind of application very effectively. It is famous for having REPL, which stands for &quot;<strong>Read-Eval-Print Loop,&quot;</strong> which makes it the most suitable language for command-line applications.</p><p>Python provides many free library or module which helps to build the command-line apps. The necessary <strong>IO</strong> libraries are used to read and write. It helps to parse argument and create console help text out-of-the-box. There are also advanced libraries that can develop independent console apps.</p><h3>4) Software Development</h3><p>Python is useful for the software development process. It works as a support language and can be used to build control and management, testing, etc.</p><ul><li><strong>SCons</strong> is used to build control.</li><li><strong>Buildbot</strong> and <strong>Apache</strong> Gumps are used for automated continuous compilation and testing.</li><li><strong>Round</strong> or <strong>Trac</strong> for bug tracking and project management.</li></ul><h3>5) Scientific and Numeric</h3><p>This is the era of artificial intelligence, where machines can perform tasks just like humans. Python is the most suitable language for artificial intelligence or machine learning. It consists of many scientific and mathematical libraries, which make it easy to solve complex calculations.</p><p>Implementing machine learning algorithms requires complex mathematical calculations. Python has many libraries for scientific and numerical computing, such as Numpy, Pandas, Scipy, Scikit-learn, etc. If you have some basic knowledge of Python, you need to import libraries at the top of the code. A few popular frameworks for machine libraries are given below.</p><ul><li>SciPy</li><li>Scikit-learn</li><li>NumPy</li><li>Pandas</li><li>Matplotlib</li></ul><h3>6) Business Applications</h3><p>Business applications differ from standard applications. E-commerce and ERP are examples of business applications. This kind of application requires extensive scalability and readability, and Python provides all these features.</p><p>Oddo is an example of an all-in-one Python-based application that offers a range of business applications. Python provides a <strong>Tryton</strong> platform, which is used to develop the business application.</p><h3>7) Audio or Video-based Applications</h3><p>Python is flexible enough to perform multiple tasks and can be used to create multimedia applications. Some multimedia applications that are made with Python are <strong>TimPlayer, cplay,</strong> etc. The few multimedia libraries are listed below.</p><ul><li>Gstreamer</li><li>Pyglet</li><li>QT Phonon</li></ul><h3>8) 3D CAD Applications</h3><p>CAD (computer-aided design) is used to design engineering-related architecture. It is used to develop the 3D representation of a part of a system. Python can create a 3D CAD application by using the following functionalities:</p><ul><li>Fandango (Popular )</li><li>CAMVOX</li><li>HeeksCNC</li><li>AnyCAD RCAM</li></ul><h3>9) Enterprise Applications</h3><p>Python can be used to create applications that can be used within an enterprise or organization. Some real-time applications are OpenERP, Tryton, Picalo, etc.</p><h3>10) Image Processing Application</h3><p>Python contains many libraries that are used to work with the image. The image can be manipulated according to our requirements. Some libraries for image processing are given below.</p><p>In this topic, we have described all types of applications where Python plays an essential role in the development of these applications. In the next tutorial, we will learn more concepts about Python.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33498430938a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/python-tutorial-python-programming-language/python-applications-python-tutorial-33498430938a">Python Applications — python tutorial</a> was originally published in <a href="https://medium.com/python-tutorial-python-programming-language">Python Tutorial | Python Programming Language</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Features — Python Tutorial]]></title>
            <link>https://medium.com/python-tutorial-python-programming-language/python-features-python-tutorial-bbfce758436e?source=rss----d6d0bcd8c0fa---4</link>
            <guid isPermaLink="false">https://medium.com/p/bbfce758436e</guid>
            <category><![CDATA[features-of-python]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python-functions]]></category>
            <category><![CDATA[function-of-python]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Rajguleria]]></dc:creator>
            <pubDate>Thu, 12 Jan 2023 14:41:26 GMT</pubDate>
            <atom:updated>2023-01-12T14:40:39.369Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python Features — Python Tutorial</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vtaECRDYAew238Q_OIpYaQ.png" /></figure><p>Python provides many useful features that make it popular and valuable compared to other programming languages. It supports object-oriented programming and procedural programming approaches and provides dynamic memory allocation. We have listed below a few essential features.</p><h3>1) Easy to Learn and Use</h3><p>Python is easy to learn as compared to other programming languages. Its syntax is straightforward and much the same as that of the English language. There is no use of the semicolon or curly bracket; the indentation defines the code block. It is the recommended programming language for beginners.</p><h3>2) Expressive Language</h3><p>Python can perform complex tasks using a few lines of code. A simple example, the hello world program you simply type <strong>print(“Hello World”)</strong>. It will take only one line to execute, while Java or C takes multiple lines.</p><h3>3) Interpreted Language</h3><p>Python is an interpreted language, which means the Python program is executed one line at a time. The advantage of being an interpreted language is that it makes debugging easy and portable.</p><h3>4) Cross-platform Language</h3><p>Python can run equally well on different platforms such as Windows, Linux, UNIX, Macintosh, etc. So, we can say that Python is a portable language. It enables programmers to develop the software for several competing platforms by writing a program only once.</p><h3>5) Free and Open Source</h3><p>Python is freely available for everyone. It is freely available on its official website, <a href="https://www.python.org/">www.python.org</a>. It has a large community across the world that is dedicatedly working towards make new python modules and functions. Anyone can contribute to the Python community. The term &quot;open-source&quot; means “anyone can download its source code without paying a penny.”</p><h3>6) Object-Oriented Language</h3><p>Python supports an object-oriented language, and concepts of classes and objects come into existence. It supports inheritance, polymorphism, and encapsulation, etc. The object-oriented procedure helps programmers write reusable code and develop applications with less code.</p><h3>7) Extensible</h3><p>It implies that other languages such as C/C++ can be used to compile the code, and thus it can be used further in our Python code. It converts the program into byte code, and any platform can use that byte code.</p><h3>8) Large Standard Library</h3><p>It provides a vast range of libraries for the various fields such as machine learning, web developer, and also for the scripting. There are various machine learning libraries, such as TensorFlow, Pandas, Numpy, Keras, PyTorch, etc. Django, Flask, and Pyramids are the popular frameworks for Python web development.</p><h3>9) GUI Programming Support</h3><p>A graphic user interface is used for the developing desktop application. PyQT5, Tkinter, and Kivy are the libraries that are used for developing the web application.</p><h3>10) Integrated</h3><p>It can be easily integrated with languages like C, C++, and JAVA, etc. Python runs code line by line like C, C++, and Java. It makes it easy to debug the code.</p><h3>11. Embeddable</h3><p>The code of the other programming language can be used in the Python source code. We can use Python source code in another programming language as well. It can embed other languages into our code.</p><h3>12. Dynamic Memory Allocation</h3><p>In Python, we don’t need to specify the data type of the variable. When we assign some value to the variable, it automatically allocates the memory to the variable at run time. Suppose we are assigned the integer value 15 to <strong>x,</strong> then we don’t need to write <strong>int x = 15.</strong> Just write &quot;x = 15.&quot;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbfce758436e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/python-tutorial-python-programming-language/python-features-python-tutorial-bbfce758436e">Python Features — Python Tutorial</a> was originally published in <a href="https://medium.com/python-tutorial-python-programming-language">Python Tutorial | Python Programming Language</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>