{"id":100136,"date":"2021-02-22T11:00:00","date_gmt":"2021-02-22T09:00:00","guid":{"rendered":"https:\/\/examples.javacodegeeks.com\/?p=100136"},"modified":"2022-07-07T15:16:39","modified_gmt":"2022-07-07T12:16:39","slug":"python-tutorial-for-beginners","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/","title":{"rendered":"Python Tutorial for Beginners (with video)"},"content":{"rendered":"<p>This is a Python tutorial for beginners.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-1-introduction\"><a name=\"introduction\"><\/a>1. Introduction<\/h2>\n<p>Python is one of the most widely used programming languages today. It first appeared in 1991. In this article, we will take a deep dive into Python.<\/p>\n<p>You can also check this tutorial in the following video:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/www.youtube.com\/watch?v=QZKDqSi7-3k\"><img decoding=\"async\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/Python-Tutorial-For-Beginners-1024x576.jpg\" alt=\"\" class=\"wp-image-113867\" width=\"512\" height=\"288\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/Python-Tutorial-For-Beginners-1024x576.jpg 1024w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/Python-Tutorial-For-Beginners-300x169.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/Python-Tutorial-For-Beginners-768x432.jpg 768w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/Python-Tutorial-For-Beginners.jpg 1280w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><figcaption>Python Tutorial For Beginners &#8211; video<\/figcaption><\/figure>\n<\/div>\n<div class=\"toc\">\n<h3>Table Of Contents<\/h3>\n<dl>\n<dt><a href=\"#introduction\">1. Introduction<\/a><\/dt>\n<dt><a href=\"#whatPython\">2. What is Python?<\/a><\/dt>\n<dt><a href=\"#popularity\">3. Why is Python so popular?<\/a><\/dt>\n<dt><a href=\"#installation\">4. Installation steps and verification<\/a><\/dt>\n<dt><a href=\"#start\">5. Getting started<\/a><\/dt>\n<dt><a href=\"#firstProg\">6. Very first program<\/a><\/dt>\n<dt><a href=\"#syntax\">7. Python Syntax<\/a><\/dt>\n<dt><a href=\"#keywords\">8. Python Keywords<\/a><\/dt>\n<dt><a href=\"#variables\">9. Python Variables<\/a><\/dt>\n<dt><a href=\"#datatypes\">10. Python datatypes<\/a><\/dt>\n<dt><a href=\"#program\">11. Simple Program<\/a><\/dt>\n<dt><a href=\"#summary\">12. Summary<\/a><\/dt>\n<dt><a href=\"#rel_art\">13. Related Articles<\/a><\/dt>\n<dt><a href=\"#sourceCode\">14. Download the Source code<\/a><\/dt>\n<\/dl>\n<\/div>\n<p>&nbsp;<\/p>\n<h2 class=\"wp-block-heading\"><a name=\"whatPython\"><\/a>2. What is Python?<\/h2>\n<p>Guido van Rossum created Python as a successor to the ABC programming language. The first version of Python got released in 1991. The most recent version is 3.9.1, which got released in December 2020.<\/p>\n<p>Python is an interpreted language, which means that it has an interpreter instead of a compiler that converts code to machine language and executes it. This feature enables Python to be platform-independent. Python is also object-oriented, dynamically typed and garbage collected.<\/p>\n<h2 class=\"wp-block-heading\"><a name=\"popularity\"><\/a>3. Why is Python so popular?<\/h2>\n<p>Python is an open-source, dynamic, high-level programming language. Python is slower in terms of execution than other programming languages like Java, C, etc. It is, however, more popular. The reason for this popularity is as follows:<\/p>\n<ul class=\"wp-block-list\">\n<li>Easy to code:<br \/>It is a developer-friendly language, and it is effortless to learn the basic syntax of Python.<\/li>\n<li>Free and Open Source:<br \/>Python language is freely available. Since it is open-source, this means that source code is also visible to the public. So you can download and customize it.<\/li>\n<li>Object-Oriented Language:<br \/>One of the critical features of python is Object-Oriented programming. Python supports object-oriented language and concepts of classes, objects encapsulation, etc.<\/li>\n<li>GUI Programming Support.<\/li>\n<li>High-Level Language:<br \/>Python is a high-level language, so developers don\u2019t need to bother about system architecture and memory management.<\/li>\n<li>Extensible feature:<br \/>Python is an&nbsp;Extensible&nbsp;language. We can embed Python snippets in other languages as well.<\/li>\n<li>Python is a Portable language:<br \/>It is platform-independent.<\/li>\n<li>Interpreted Language:<br \/>Python is interpreted into bytecode, not compiled, which makes it easier to debug<\/li>\n<li>Large Standard Library<br \/>Python has a rich library of in-built functions. It is effortless to include other libraries in Python.<\/li>\n<li>Dynamically Typed Language:<br \/>Python is a dynamically-typed language. We do not need to specify the datatype of the variable.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\"><a name=\"installation\"><\/a>4. Installation steps and verification<\/h2>\n<p>To get started with Python, we first have to install it on our systems. Generally, the Linux and Mac OS already have Python installed.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-4-1-verify-python-version\">4.1 Verify Python version<\/h3>\n<p>To check if Python is present on your machine,<\/p>\n<ul class=\"wp-block-list\" type=\"1\">\n<li>Open Command Prompt or cmd<\/li>\n<li>Type the command:<\/li>\n<\/ul>\n<pre class=\"brush:bash\"> python -v<\/pre>\n<p>If Python is present, then the above command gives back the version number. If not, then the below message is displayed.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_version.jpg\"><img decoding=\"async\" width=\"800\" height=\"163\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_version.jpg\" alt=\"python tutorial - Checking Python version\" class=\"wp-image-100139\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_version.jpg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_version-300x61.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_version-768x156.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption>Checking Python version<\/figcaption><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-4-2-install-python\">4.2 Install Python<\/h3>\n<p>&nbsp;For Windows users, there are a couple of different ways to install Python<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-4-2-1-the-microsoft-store\">4.2.1 The Microsoft Store<\/h4>\n<ul class=\"wp-block-list\">\n<li>Open the Microsoft Store.<\/li>\n<li>In the window that opens, type \u201cPython\u201d in the search box.<\/li>\n<li>Choose the latest version.<\/li>\n<li>Hit \u201cGet\u201d button to start the installation.<\/li>\n<\/ul>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_microsoft_Store.jpg\"><img decoding=\"async\" width=\"800\" height=\"624\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_microsoft_Store.jpg\" alt=\"python tutorial - Microsoft store Python installation\" class=\"wp-image-100140\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_microsoft_Store.jpg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_microsoft_Store-300x234.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_microsoft_Store-768x599.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption>Microsoft store Python installation<\/figcaption><\/figure>\n<\/div>\n<p>Alternatively, we can also open cmd and type <code>python<\/code> and, hit Enter. The command will open the same window as above. The Python that gets installed is not the complete package. It is enough if you are a beginner at Python. However, for the advanced concepts of Python, the complete package is preferred.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-4-2-2-download-the-latest-package-from-the-official-python-site\">4.2.2 Download the latest package from the official Python site.<\/h4>\n<p>The following are the steps to be followed:<\/p>\n<ul class=\"wp-block-list\">\n<li>Go to the official <a href=\"https:\/\/www.python.org\/downloads\" target=\"_blank\" rel=\"noreferrer noopener\">Python site<\/a>.<\/li>\n<li>Click on the Download Python button.<\/li>\n<li>The file that gets downloaded is python-3.9.1-amd64.exe<\/li>\n<li>Double click on the file and follow the steps.<\/li>\n<\/ul>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_installation.jpg\"><img decoding=\"async\" width=\"800\" height=\"523\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_installation.jpg\" alt=\"python tutorial - Python.org installation\" class=\"wp-image-100141\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_installation.jpg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_installation-300x196.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_installation-768x502.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption>Python.org installation<\/figcaption><\/figure>\n<\/div>\n<p>The Python installed using the above steps is the complete Python package and is the recommended installation method. To verify that Python has installed correctly, repeat the steps for \u201cVerify Python version.\u201d You should be able to see output similar to this.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_installed.jpg\"><img decoding=\"async\" width=\"487\" height=\"239\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_installed.jpg\" alt=\"python tutorial - Python installed\" class=\"wp-image-100142\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_installed.jpg 487w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python_installed-300x147.jpg 300w\" sizes=\"(max-width: 487px) 100vw, 487px\" \/><\/a><figcaption>Python installed<\/figcaption><\/figure>\n<\/div>\n<p>We can also install Python by using distributions like Anaconda. Anaconda is a package management and deployment system and greatly simplifies adding other libraries to Python. To download Anaconda, download visit <a href=\"https:\/\/www.anaconda.com\/products\/individual#windows\" target=\"_blank\" rel=\"noreferrer noopener\">this site<\/a>. The Anaconda documentation is available <a href=\"https:\/\/docs.anaconda.com\/anaconda\/install\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n<h2 class=\"wp-block-heading\"><a name=\"start\"><\/a>5. Python Tutorial &#8211; Getting started<\/h2>\n<p>There are multiple ways in which we can code using Python. We can use the inbuilt interpreter, code editors, and even software like Jupyter notebooks packaged in an Anaconda distribution.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-5-1-python-interpreter\">5.1 Python interpreter<\/h3>\n<p>Python comes with a default interactive interpreter. To run the interpreter<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<ul class=\"wp-block-list\">\n<li>Open a Command Prompt using the cmd command.<\/li>\n<li>Type the command<\/li>\n<\/ul>\n<pre class=\"brush:bash\">python<\/pre>\n<p>Doing this opens an interpreter where we can start coding in Python right away. To exit the interpreter, press Ctrl key + Z and press Enter.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/Python_interpreter.jpg\"><img decoding=\"async\" width=\"820\" height=\"271\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/Python_interpreter.jpg\" alt=\"python tutorial - REPL or interpreter\" class=\"wp-image-100143\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/Python_interpreter.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/Python_interpreter-300x99.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/Python_interpreter-768x254.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption>REPL or interpreter<\/figcaption><\/figure>\n<\/div>\n<p>It is one of the easiest ways to start coding in Python. It becomes tedious for lengthy programs.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-5-2-code-editors\">5.2 Code editors<\/h3>\n<p>There are multiple code editors available that provide support for Python. Some of the most popular code editors for Python are Visual Studio Code, Sublime text3, Atom, etc. Python also offers in-built code editors called IDLE that get installed with the Python installation. We will use the IDLE code editor for all our examples.<\/p>\n<p>To open the IDLE code editor, In the Search box in Windows, type IDLE. The IDLE IDE is an excellent IDE for beginners.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/idle_ide.jpg\"><img decoding=\"async\" width=\"800\" height=\"492\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/idle_ide.jpg\" alt=\"python tutorial - IDLE IDE\" class=\"wp-image-100144\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/idle_ide.jpg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/idle_ide-300x185.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/idle_ide-768x472.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption>IDLE IDE<\/figcaption><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\"><a name=\"firstProg\"><\/a> 6. Python Tutorial &#8211; The very first program<\/h2>\n<p>To get started with IDLE, we will write the first \u201cHello World\u201d program.<\/p>\n<ul class=\"wp-block-list\">\n<li>Open IDLE IDE.<\/li>\n<li>Click on the File menu and select New File<\/li>\n<li>In the window that opens, write the code:<\/li>\n<\/ul>\n<pre class=\"brush:python\">print (\u201cHello World\u201d)<\/pre>\n<ul class=\"wp-block-list\">\n<li>Click on File and Save the file in the location of your choice.<\/li>\n<li>Then click on the Run menu and select the first option.<\/li>\n<\/ul>\n<p>Alternatively, you can also press F5 key. This runs the program and outputs Hello World.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/first_program_idle.jpg\"><img decoding=\"async\" width=\"800\" height=\"417\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/first_program_idle.jpg\" alt=\"First Program in Python\" class=\"wp-image-100145\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/first_program_idle.jpg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/first_program_idle-300x156.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/first_program_idle-768x400.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption>First Program in Python<\/figcaption><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\"><a name=\"syntax\"><\/a>7. Python Syntax Tutorial<\/h2>\n<p>In this section, we will look at the various syntax rules related to Python<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-7-1-python-indentation\">7.1 Python Indentation<\/h3>\n<p>Unlike other programming languages, the whitespace has significance for the Python interpreter. Python uses indentation to indicate a block of code.<\/p>\n<p>For example, consider the program for checking if a code is odd or even.<\/p>\n<p><span style=\"text-decoration: underline\"><em>script1.py<\/em><\/span><\/p>\n<pre class=\"brush:python\">inputNumber = int(input(\"Enter a number: \"))\nif inputNumber % 2 ==0:\n   print(str(inputNumber) + \" is even\") \nelse:\n   print(str(inputNumber) + \" is odd\")\n<\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/syntax_1.jpg\"><img decoding=\"async\" width=\"800\" height=\"277\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/syntax_1.jpg\" alt=\"Correct indentation\" class=\"wp-image-100146\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/syntax_1.jpg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/syntax_1-300x104.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/syntax_1-768x266.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption>Correct indentation<\/figcaption><\/figure>\n<\/div>\n<p>The code above runs perfectly. If, however, in the code above, we forget to put an indent for the print line, the program will fail compilation.<\/p>\n<p><span style=\"text-decoration: underline\"><em>script1.py<\/em><\/span><\/p>\n<pre class=\"brush:python\">inputNumber = int(input(\"Enter a number: \"))\nif inputNumber % 2 ==0:\nprint(str(inputNumber) + \" is even\") \nelse:\nprint(str(inputNumber) + \" is odd\")\n<\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/syntax_error.jpg\"><img decoding=\"async\" width=\"800\" height=\"365\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/syntax_error.jpg\" alt=\"Incorrect indentation\" class=\"wp-image-100147\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/syntax_error.jpg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/syntax_error-300x137.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/syntax_error-768x350.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption>Incorrect indentation<\/figcaption><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-7-2-multi-line-statements\">7.2 Multi-Line statements<\/h3>\n<p>Generally, in Python, we write one statement on one line. However, Python allows multi-line statements. To write multi-line statements, we add a \u2018\\\u2019 at the end of each line.<\/p>\n<p>&nbsp;For example:<\/p>\n<p><span style=\"text-decoration: underline\"><em>multiLineStrings.py<\/em><\/span><\/p>\n<pre class=\"brush:python\">multiLineString = \"first line\" + \\\n                  \"second line\" + \\\n                  \"third line\"\n\nprint (multiLineString)\n<\/pre>\n<p>This script will run and print out the three lines on a single line with spaces in between.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/multiLineString.jpg\"><img decoding=\"async\" width=\"810\" height=\"293\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/multiLineString.jpg\" alt=\"Multi Line Strings\" class=\"wp-image-100148\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/multiLineString.jpg 810w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/multiLineString-300x109.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/multiLineString-768x278.jpg 768w\" sizes=\"(max-width: 810px) 100vw, 810px\" \/><\/a><figcaption>Multi Line Strings<\/figcaption><\/figure>\n<\/div>\n<p>However, if we miss the \u2018\\\u2019 at the end of the line, the script will fail with a compilation error.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/multi_string.jpg\"><img decoding=\"async\" width=\"800\" height=\"535\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/multi_string.jpg\" alt=\"Incorrect syntax error.\" class=\"wp-image-100149\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/multi_string.jpg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/multi_string-300x201.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/multi_string-768x514.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption>Incorrect syntax error.<\/figcaption><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-7-3-quotation-marks\">7.3 Quotation marks<\/h3>\n<p>Python allows single \u2018 \u2018 or double quotes \u201c \u201c or even triple quotes &#8221;&#8217; &#8221;&#8217;. The only constraint is that the quotation marks for each line need to be consistent. Meaning if a line starts with a single quote, then it should end with a single quote. For strings that span multiple lines, we use triple quotation marks. For such strings, we cannot use double or single quotation marks. At least not without the \u2018\\\u2019 character.<\/p>\n<p>The example program is as follows:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Quotation_strings.py<\/em><\/span><\/p>\n<pre class=\"brush:python\">#Correct strings\nstr1 = \u2018It is nice weather today!\u2019\nstr2 = \u201cHave a nice day.\u201d \nstr3 = \"\"\" All the world\u2019s a stage, and all the men and women merely players.\n           They have their exits and their entrances;\n           And one man in his time plays many parts.\"\"\"\nstr4 = \"\"\"This is just one line but that is allowed.\"\"\"\n\nprint (str1)\nprint (str2)\nprint (str3)\nprint (str4)\n<\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/quotations.jpg\"><img decoding=\"async\" width=\"810\" height=\"410\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/quotations.jpg\" alt=\"Quotations output\" class=\"wp-image-100150\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/quotations.jpg 810w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/quotations-300x152.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/quotations-768x389.jpg 768w\" sizes=\"(max-width: 810px) 100vw, 810px\" \/><\/a><figcaption>Quotations output<\/figcaption><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-7-4-comments-and-blank-lines\">7.4 Comments and blank lines<\/h3>\n<p>We put comments in Python using the # sign. The Python interpreter completely ignores anything after the # sign. If there is a line with just whitespaces, then that is ignored by the Python interpreter also. The # sign comments a single line. There is no syntax for a block comment. However, if we use a multi-line string, i.e. (string in triple quotes) and we do not assign it to a variable, then Python considers it a comment.<\/p>\n<p><span style=\"text-decoration: underline\"><em>commentExample.py<\/em><\/span><\/p>\n<pre class=\"brush:python\"># print (\"this is a comment\").\n\"\"\" print(\"this is a comment to\n    although it spans multiple\n    line.\")\"\"\"\n#print (\"the line below this will also be ignored since its just whitespaces.\")\n\nstr1 = \"\"\"However this is not a comment\n          since we have assigned it to a variable\"\"\"\n\nprint(str1)\n<\/pre>\n<p>All the earlier lines except the str1 are comments.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/comments_output.jpg\"><img decoding=\"async\" width=\"810\" height=\"322\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/comments_output.jpg\" alt=\"Comments\" class=\"wp-image-100151\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/comments_output.jpg 810w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/comments_output-300x119.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/comments_output-768x305.jpg 768w\" sizes=\"(max-width: 810px) 100vw, 810px\" \/><\/a><figcaption>Comments<\/figcaption><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-7-5-case-sensitive\">7.5 Case-sensitive<\/h3>\n<p>Python is a case sensitive language. Hence, the variable str1, Str1, STR1 are all different variables as per the Python interpreter. They are not interchangeable.<\/p>\n<h2 class=\"wp-block-heading\"><a name=\"keywords\"><\/a>8. Python Keywords Tutorial<\/h2>\n<p>Just like most programming languages, Python also has some keywords that the Python interpreter reserves. As of now, there are 33 keywords in Python. We cannot use keywords as variables, function names, or any other identifier. I have grouped the keywords as per their use:<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-8-1-value-keywords\">8.1 Value Keywords<\/h3>\n<p>These keywords are in uppercase and must be used as such. These keywords are boolean values.<\/p>\n<ul class=\"wp-block-list\">\n<li>False<\/li>\n<li>True<\/li>\n<li>None<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"h-8-2-operator-keywords\">8.2 Operator Keywords<\/h3>\n<p>We use these keywords for joining multiple conditions. The keywords are:<\/p>\n<ul class=\"wp-block-list\">\n<li>and<\/li>\n<li>or<\/li>\n<li>not<\/li>\n<li>in<\/li>\n<li>is<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"h-8-3-control-flow-keywords\">8.3 Control Flow Keywords<\/h3>\n<p>We can control the flow of the programs. We can use conditional logic.<\/p>\n<ul class=\"wp-block-list\">\n<li>if<\/li>\n<li>else<\/li>\n<li>elif<\/li>\n<\/ul>\n<p>We can nest multiple if-else statements using the elif statements.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-8-4-loop-or-iteration-keywords\">8.4 Loop or Iteration Keywords<\/h3>\n<p>Using these keywords, we can do repetitive tasks. The keywords are<\/p>\n<ul class=\"wp-block-list\">\n<li>for<\/li>\n<li>while<\/li>\n<li>break<\/li>\n<li>continue<\/li>\n<li>else<\/li>\n<\/ul>\n<p>We can use the else keyword with the loop keywords as well as the if keyword in &nbsp;Python.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-8-5-structure-keywords\">8.5 Structure Keywords<\/h3>\n<p>We use these keywords to define functions, classes and context managers.<\/p>\n<ul class=\"wp-block-list\">\n<li>def<\/li>\n<li>class<\/li>\n<li>with<\/li>\n<li>as<\/li>\n<li>pass<\/li>\n<li>lambda<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"h-8-6-control-return-keywords\">8.6 Control return keywords<\/h3>\n<p>The following keywords, we can use to change the control of the program.<\/p>\n<ul class=\"wp-block-list\">\n<li>return<\/li>\n<li>yield<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"h-8-7-import-keywords\">8.7 Import Keywords<\/h3>\n<p>Python reserves these keywords for adding and handling external libraries in the program<\/p>\n<ul class=\"wp-block-list\">\n<li>import<\/li>\n<li>from<\/li>\n<li>as<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"h-8-8-error-handling-keywords\">8.8 Error handling Keywords<\/h3>\n<p>The keywords handle exceptions and errors in the Python program.<\/p>\n<ul class=\"wp-block-list\">\n<li>try<\/li>\n<li>except<\/li>\n<li>raise<\/li>\n<li>finally<\/li>\n<li>else<\/li>\n<li>assert<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"h-8-9-asynchronous-programming-keywords\">8.9 Asynchronous programming Keywords<\/h3>\n<p>These keywords are for asynchronous programming. Asynchronous programming is an advanced topic and we will not explore it in this topic.<\/p>\n<ul class=\"wp-block-list\">\n<li>async<\/li>\n<li>await<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"h-8-10-variable-handling-keywords\">8.10 Variable-handling keywords<\/h3>\n<p>We can use these keywords for specific variables. The keywords are:<\/p>\n<ul class=\"wp-block-list\">\n<li>del<\/li>\n<li>global<\/li>\n<li>nonlocal<\/li>\n<\/ul>\n<p>Python deprecated the keywords print and exec and replaced them with in-built functions.<\/p>\n<h2 class=\"wp-block-heading\"><a name=\"variables\"><\/a>9. Python Variables Tutorial<\/h2>\n<p>Python has dynamic typing, i.e., we do not need to define the datatype when we declare a variable. We can change the variable\u2019s datatype to some other datatypes later as well. For example:<\/p>\n<pre class=\"brush:python\">x =12 \n\u2026\u2026 \n x =\u201dIt is nice today!\u201d\n<\/pre>\n<p>The example code is valid in Python.<\/p>\n<p>There are specific rules we use for variable names. They are as follows:<\/p>\n<ul class=\"wp-block-list\">\n<li>A variable name must start with a letter or the underscore character.<\/li>\n<li>It cannot start with a number.<\/li>\n<li>A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ ).<\/li>\n<li>Variable names are case-sensitive (age, Age, and AGE are three different variables).<\/li>\n<li>Python allows the Camel Case, for example, myVar, Pascal Case, i.e., MyVar, or the Snake Case, for instance, my_var for writing variable names with multiple words.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\"><a name=\"datatypes\"><\/a>10. Python datatypes Tutorial<\/h2>\n<p>Like every programming language, Python has datatypes to assist in programming. The datatypes that Python supports are as follows:<\/p>\n<figure class=\"wp-block-table aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Type of values<\/strong><\/td>\n<td><strong>datatype name<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Text<\/td>\n<td>str<\/td>\n<\/tr>\n<tr>\n<td>Numeric<\/td>\n<td>int, float, complex<\/td>\n<\/tr>\n<tr>\n<td>Collection of objects\/text\/numbers<\/td>\n<td>list, tuple, range <\/td>\n<\/tr>\n<tr>\n<td>Map<\/td>\n<td>dict<\/td>\n<\/tr>\n<tr>\n<td>Sets<\/td>\n<td>set, frozenset<\/td>\n<\/tr>\n<tr>\n<td>Boolean<\/td>\n<td>bool<\/td>\n<\/tr>\n<tr>\n<td>Binary<\/td>\n<td>bytes, bytearray, memoryview<\/td>\n<\/tr>\n<\/tbody>\n<\/table><figcaption>Different datatypes in Python<\/figcaption><\/figure>\n<\/p>\n<p>As mentioned before, Python is dynamically-typed. Hence, if we want to know the data type of a variable, we can use the type() function.<\/p>\n<h2 class=\"wp-block-heading\"><a name=\"program\"><\/a>11. Simple Program<\/h2>\n<p>Python has a rich library of in-built functions, especially for the str datatype. Going through each of the methods is not possible. However, we will see a sample program where we use many keywords and datatypes together. To get a complete list of in-built functions, check the <a href=\"https:\/\/docs.python.org\/3\/library\/functions.html\" target=\"_blank\" rel=\"noreferrer noopener\">Python documentation library<\/a>. We will look at a simple, sample program that uses a few of the most commonly-used built-in functions in Python.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Utilities.py<\/em><\/span><\/p>\n<pre class=\"brush:python\">#To print anything on the console\nprint(\"Hello World!!\\n\")\nprint(\"***********************************************************\\n\")\n\n#add to numbers we use the + operator.\n#Subtract, multiply and divide are similar\nprint(\"Enter the first number: \")\nnum1 = int(input())\n\nprint(\"Enter the second number: \")\nnum2 = int(input())\nsum1 = num1 + num2\n\n#We cannot concat strings and numbers together.\n#We need to cast to string by using str()\n#Using + with 2 strings, concats or joins them together.\nprint(\"Sum is: \" + str(sum1))\nprint(\"***********************************************************\\n\")\n\n#int is automatically cast to a float during division\nnum3 = 12\nnum4 = 7\n\nresult = num3\/num4\n#We can also get a rounded result\nroundedValue = round(num1\/num2)\nprint(type(num3))\nprint(type(num4))\nprint(type(result))\n\nprint(str(result))\nprint(str(roundedValue))\nprint(\"***********************************************************\\n\")\n\nnum4 = 100\nnum5 = 200\n\n#This will give a negative number\ndiff = num4 - num5\n\nprint(diff)\n#But if we want the absolute value we can use the abs() function \nprint(str(abs(diff)) + \"\\n\")\nprint(\"***********************************************************\\n\")\n\n#We can sort a list using an inbuilt function\nlst = [27,16,250,3,10,54]\n#Python will sort the list and print it out for us.\nprint(sorted(lst))\nprint(\"***********************************************************\\n\")\n\n#String methods\n#To remove whitespaces from a string, we use strip()\nstr1 = \"                    This has a lot of whitespaces               \"\nprint(str1.strip() + \"\\n\")\n\n#To reverse a string without loops.\nstr2=\"I would like to reverse this string.\"\n\n#While this is not a in-built function , it is a very important construct for splicing strings. \nprint(str2[:: -1] + \"\\n\")\nprint(\"***********************************************************\\n\")\n\nstr3 = \"\"\" All the world\u2019s a stage, and all the men and women merely players,\n           They have their exits and their entrances,\n           And one man in his time plays many parts.\"\"\"\n\n#To split a string, we use the split() method.\n#If we do not specify a delimiter, the string is slit using whitespaces.\nprint(str3.split())\nprint('\\n')\n\n#To specify a delimiter, like ',' we do\n'''When the string is split using a delimeter and not word by word, python will consider \nthe new line and whitespaces as a part of the string.'''\n\nprint(str3.split(\",\"))\nprint(\"***********************************************************\\n\")<\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/sample_output.jpg\"><img decoding=\"async\" width=\"800\" height=\"803\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/sample_output.jpg\" alt=\"Output of the Program\" class=\"wp-image-100152\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/sample_output.jpg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/sample_output-300x300.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/sample_output-150x150.jpg 150w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/sample_output-768x771.jpg 768w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/sample_output-70x70.jpg 70w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption>Output of the Program<\/figcaption><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\"><a name=\"summary\"><\/a>12. Python Tutorial &#8211; Summary<\/h2>\n<p>In this python tutorial, we looked at the basics of the Python programming language and began coding with Python through examples. <\/p>\n<p>Python is dynamically-typed, easy to use, and has a rich library of in-built functions. The functions we have seen in this article are just the tip of the iceberg that is Python. <\/p>\n<p>You can learn more through our <a href=\"https:\/\/examples.javacodegeeks.com\/category\/python\/\">Python tutorials<\/a>.<\/p>\n<p>To get resources related to Python, please visit the <a href=\"https:\/\/wiki.python.org\/moin\/BeginnersGuide\/Programmers\" target=\"_blank\" rel=\"noreferrer noopener\">python wiki page<\/a>.<\/p>\n<h2 class=\"wp-block-heading\"><a name=\"rel_art\"><\/a>13. Related articles<\/h2>\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/how-to-download-python\/\">How to Download Python<\/a><\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/python-input-method-tutorial\/\">Python input() method Tutorial<\/a><\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/python-regex-tutorial\/\">Python RegEx Tutorial<\/a><\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/queue-in-python\/\">Queue in Python<\/a><\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/python-json-example\/\">Python JSON Example<\/a><\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/introduction-to-the-flask-python-web-app-framework\/\">Introduction to the Flask Python Web App Framework<\/a><\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/selenium-with-python-example\/\">Selenium with Python Example<\/a><\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/python-random-module-tutorial\/\">Python Random Module Tutorial<\/a><\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\"><a name=\"sourceCode\"><\/a>14. Download the Source code<\/h2>\n<p>This was a tutorial on Python for beginners.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/Python_scripts.zip\"><strong> Python Tutorial for Beginners<\/strong><\/a><\/div>\n<p><strong>Last updated on Jan. 14th, 2022<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a Python tutorial for beginners. 1. Introduction Python is one of the most widely used programming languages today. It first appeared in 1991. In this article, we will take a deep dive into Python. You can also check this tutorial in the following video: Python Tutorial For Beginners &#8211; video Table Of Contents &hellip;<\/p>\n","protected":false},"author":232,"featured_media":99891,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46689],"tags":[],"class_list":["post-100136","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python Tutorial for Beginners (with video) - Examples Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Python tutorial: One of the most widely used programming languages today. It is object-oriented, dynamically typed and garbage collected.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Tutorial for Beginners (with video) - Examples Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Python tutorial: One of the most widely used programming languages today. It is object-oriented, dynamically typed and garbage collected.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-22T09:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-07T12:16:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Reshma Sathe\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Reshma Sathe\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"15 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/\"},\"author\":{\"name\":\"Reshma Sathe\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/079aa9a12c7b8ebea3391ebeb6036a74\"},\"headline\":\"Python Tutorial for Beginners (with video)\",\"datePublished\":\"2021-02-22T09:00:00+00:00\",\"dateModified\":\"2022-07-07T12:16:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/\"},\"wordCount\":2044,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/\",\"name\":\"Python Tutorial for Beginners (with video) - Examples Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg\",\"datePublished\":\"2021-02-22T09:00:00+00:00\",\"dateModified\":\"2022-07-07T12:16:39+00:00\",\"description\":\"Python tutorial: One of the most widely used programming languages today. It is object-oriented, dynamically typed and garbage collected.\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"set python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/web-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/web-development\/python\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Python Tutorial for Beginners (with video)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/079aa9a12c7b8ebea3391ebeb6036a74\",\"name\":\"Reshma Sathe\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/reshma_sathe-96x96.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/reshma_sathe-96x96.png\",\"caption\":\"Reshma Sathe\"},\"description\":\"I am a recent Master of Computer Science degree graduate from the University Of Illinois at Urbana-Champaign.I have previously worked as a Software Engineer with projects ranging from production support to programming and software engineering.I am currently working on self-driven projects in Java, Python and Angular and also exploring other frontend and backend technologies.\",\"sameAs\":[\"www.linkedin.com\/in\/reshma-sathe\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/reshma-sathe\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Tutorial for Beginners (with video) - Examples Java Code Geeks","description":"Python tutorial: One of the most widely used programming languages today. It is object-oriented, dynamically typed and garbage collected.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/","og_locale":"en_US","og_type":"article","og_title":"Python Tutorial for Beginners (with video) - Examples Java Code Geeks","og_description":"Python tutorial: One of the most widely used programming languages today. It is object-oriented, dynamically typed and garbage collected.","og_url":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2021-02-22T09:00:00+00:00","article_modified_time":"2022-07-07T12:16:39+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg","type":"image\/jpeg"}],"author":"Reshma Sathe","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Reshma Sathe","Est. reading time":"15 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/"},"author":{"name":"Reshma Sathe","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/079aa9a12c7b8ebea3391ebeb6036a74"},"headline":"Python Tutorial for Beginners (with video)","datePublished":"2021-02-22T09:00:00+00:00","dateModified":"2022-07-07T12:16:39+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/"},"wordCount":2044,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/","url":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/","name":"Python Tutorial for Beginners (with video) - Examples Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg","datePublished":"2021-02-22T09:00:00+00:00","dateModified":"2022-07-07T12:16:39+00:00","description":"Python tutorial: One of the most widely used programming languages today. It is object-oriented, dynamically typed and garbage collected.","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg","width":150,"height":150,"caption":"set python"},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/python-tutorial-for-beginners\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Development","item":"https:\/\/examples.javacodegeeks.com\/category\/web-development\/"},{"@type":"ListItem","position":3,"name":"Python","item":"https:\/\/examples.javacodegeeks.com\/category\/web-development\/python\/"},{"@type":"ListItem","position":4,"name":"Python Tutorial for Beginners (with video)"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/079aa9a12c7b8ebea3391ebeb6036a74","name":"Reshma Sathe","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/reshma_sathe-96x96.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/reshma_sathe-96x96.png","caption":"Reshma Sathe"},"description":"I am a recent Master of Computer Science degree graduate from the University Of Illinois at Urbana-Champaign.I have previously worked as a Software Engineer with projects ranging from production support to programming and software engineering.I am currently working on self-driven projects in Java, Python and Angular and also exploring other frontend and backend technologies.","sameAs":["www.linkedin.com\/in\/reshma-sathe"],"url":"https:\/\/examples.javacodegeeks.com\/author\/reshma-sathe\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/100136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/232"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=100136"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/100136\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/99891"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=100136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=100136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=100136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}