{"id":90,"date":"2024-09-04T18:06:02","date_gmt":"2024-09-04T18:06:02","guid":{"rendered":"https:\/\/www.zframez.com\/articles\/?p=90"},"modified":"2024-10-16T14:51:09","modified_gmt":"2024-10-16T14:51:09","slug":"chapter-2-setting-up-python","status":"publish","type":"post","link":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python","title":{"rendered":"Chapter 2: Setting Up Python"},"content":{"rendered":"<body>\n<div class=\"table-of-contents\" style=\"background-color: #066095; color: white; padding: 10px; border-radius: 10px; margin-top: 20px; display: flex; justify-content: space-between; align-items: center; font-weight: 600;\">\n  <span style=\"flex: 1; text-align: left;\">\n    <a href=\"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-1-introduction-to-python-programming\" style=\"color: white; text-decoration: underline;\">\u25c0 Previous<\/a>\n  <\/span>\n  \n  <span style=\"flex: 1; text-align: center;\">\n    <a href=\"https:\/\/www.zframez.com\/articles\/python-tutorials\" style=\"color: white; text-decoration: underline;\">Python Tutorials<\/a>\n  <\/span>\n  \n  <span style=\"flex: 1; text-align: right;\">\n    <a href=\"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-3-working-with-variables-in-python\" style=\"color: white; text-decoration: underline;\">Next \u25b6<\/a>\n  <\/span>\n<\/div>\n\n\n\n\n<p>Before you can start writing and running Python code, you\u2019ll need to set up Python on your computer. In this chapter, we\u2019ll guide you through the process of installing Python on Windows, macOS, and Linux. We\u2019ll also explain what an Integrated Development Environment (IDE) is and help you pick the one that suits you best. By the end of this chapter, you\u2019ll have everything set up and ready to start writing Python code, no matter which operating system you\u2019re using. Let\u2019s get your Python environment up and running smoothly!<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<div style=\"background: linear-gradient(to right, #ADD8E6, #8A2BE2); padding: 10px; border-radius: 10px; font-weight: 600; color: black;\">\n  <h3 style=\"text-align: center; margin-top: 0;\">Table of Contents<\/h3>\n  <ul style=\"padding-left: 20px;\">\n    <li><a href=\"#How-to-Install-Python-on-Windows\" style=\"color: black;\">How to Install Python on Windows<\/a><\/li>\n    <li><a href=\"#How-to-Install-Python-on-macOS\" style=\"color: black;\">How to Install Python on macOS<\/a><\/li>\n    <li><a href=\"#How-to-Install-Python-on-Linux-Ubuntu-Debian-Fedora\" style=\"color: black;\">How to Install Python on Linux (Ubuntu\/Debian\/Fedora)<\/a><\/li>\n    <li><a href=\"#What-is-an-IDE\" style=\"color: black;\">What is an IDE?<\/a><\/li>\n    <li><a href=\"#What-are-the-Popular-IDEs-for-Python\" style=\"color: black;\">What are the Popular IDEs for Python?<\/a><\/li>\n    <li><a href=\"#How-to-Use-IDLE\" style=\"color: black;\">How to Use IDLE<\/a><\/li>\n  <\/ul>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h1 class=\"wp-block-heading has-x-large-font-size\" id=\"How-to-Install-Python\"><strong>How to Install Python<\/strong><\/h1>\n\n\n\n<p>Python can be installed on various operating systems, including Windows, macOS, and Linux. Here\u2019s a step-by-step guide to installing Python on each platform.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\" id=\"How-to-Install-Python-on-Windows\"><strong>How to Install Python on Windows<\/strong><\/h2>\n\n\n\n<p>1.<strong> Download the Installer<\/strong>: Visit the official Python website(https:\/\/www.python.org\/downloads\/) and download the latest version of Python for Windows.<\/p>\n\n\n\n<p>2. <strong>Run the Installer<\/strong>: Locate the downloaded file and double-click to run the installer.<\/p>\n\n\n\n<p>3. <strong>Customize Installation <\/strong>(Optional): You can choose the installation location and select optional features.<\/p>\n\n\n\n<p>4. <strong>Add Python to PATH<\/strong>: Ensure the \u201cAdd Python to PATH\u201d checkbox is selected before clicking \u201cInstall Now\u201d.<\/p>\n\n\n\n<p>5. <strong>Complete the Installation<\/strong>: Follow the prompts to complete the installation. You can verify the installation by opening Command Prompt and typing `python \u2013version`.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\" id=\"How-to-Install-Python-on-macOS\"><strong>How to Install Python on macOS<\/strong><\/h2>\n\n\n\n<p>1. <strong>Download the Installer<\/strong>: Visit the official Python website(https:\/\/www.python.org\/downloads\/) and download the latest version of Python for macOS.<\/p>\n\n\n\n<p>2. <strong>Run the Installer<\/strong>: Open the downloaded .pkg file and follow the prompts to install Python.<\/p>\n\n\n\n<p>3. <strong>Verify the Installation<\/strong>: Open Terminal and type `python3 \u2013version` to verify the installation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\" id=\"How-to-Install-Python-on-Linux-Ubuntu-Debian-Fedora\"><strong>How to Install Python on Linux (Ubuntu\/ Debian\/ Fedora)<\/strong><\/h2>\n\n\n\n<p>Most Linux distributions come with Python pre-installed. However, you can install the latest version using your package manager.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-medium-font-size\"><strong>Ubuntu\/Debian<\/strong>:<\/h3>\n\n\n\n<p>1. Update the Package List: Open Terminal and run `<strong>sudo apt update<\/strong>`.<\/p>\n\n\n\n<p>2. Install Python: Run `sudo apt install python3`.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-medium-font-size\"><strong>Fedora<\/strong>:<\/h3>\n\n\n\n<p>1. Update the Package List: Open Terminal and run `<strong>sudo dnf update<\/strong>`.<\/p>\n\n\n\n<p>2. Install Python: Run `<strong>sudo dnf install python3<\/strong>`.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\" id=\"What-is-an-IDE\"><strong>What is an IDE?<\/strong><\/h2>\n\n\n\n<p>You can create a Python script using any text editor, such as Notepad or Notepad++ on Windows, and Vim or Gedit on Linux devices. After creating the script, you can run it from the command prompt using the command \u201cpython &lt;script name&gt;\u201d. However, a more convenient option would be to use an IDE. An Integrated Development Environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE typically consists of:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Code Editor<\/strong>: A text editor designed for writing and editing source code.<\/li>\n\n\n\n<li><strong>Debugger<\/strong>: A tool that helps in testing and debugging the code.<\/li>\n\n\n\n<li><strong>Compiler\/Interpreter<\/strong>: Converts the written code into a format that can be executed by the computer.<\/li>\n\n\n\n<li><strong>Build Automation Tools<\/strong>: Tools that automate the process of compiling code and managing dependencies.<\/li>\n<\/ul>\n\n\n\n<p>IDEs enhance productivity by offering various features like syntax highlighting, code completion, and version control integration. They provide a centralized interface with all the necessary tools for developing software, making the development process more efficient and streamlined.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\" id=\"What-are-the-Popular-IDEs-for-Python\"><strong>What are the Popular IDEs for Python?<\/strong><\/h2>\n\n\n\n<p>Several IDEs are popular among Python developers, each with its unique features and capabilities:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>IDLE<\/strong>:\n<ul class=\"wp-block-list\">\n<li>The default IDE that comes with the standard Python distribution.<\/li>\n\n\n\n<li>It is simple and lightweight, suitable for beginners.<\/li>\n\n\n\n<li>IDLE offers basic features like a code editor, interactive shell, and debugging tools.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>PyCharm<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Developed by JetBrains, PyCharm is one of the most popular IDEs for Python.<\/li>\n\n\n\n<li>It offers advanced code editing, debugging, and testing features.<\/li>\n\n\n\n<li>PyCharm comes in two versions: Community (free) and Professional (paid).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Visual Studio Code (VS Code)<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Developed by Microsoft, VS Code is a lightweight yet powerful source code editor.<\/li>\n\n\n\n<li>It supports Python through extensions and provides features like debugging, syntax highlighting, and code navigation.<\/li>\n\n\n\n<li>VS Code is highly customizable with a wide range of plugins.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Spyder<\/strong>:\n<ul class=\"wp-block-list\">\n<li>An open-source IDE specifically designed for data science and scientific computing.<\/li>\n\n\n\n<li>It integrates well with libraries like NumPy, SciPy, and Matplotlib.<\/li>\n\n\n\n<li>Spyder offers features such as an interactive console, variable explorer, and advanced editing capabilities.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Jupyter Notebook<\/strong>:\n<ul class=\"wp-block-list\">\n<li>An open-source web application that allows you to create and share documents containing live code, equations, visualizations, and narrative text.<\/li>\n\n\n\n<li>It is widely used in data science and machine learning for its interactive and exploratory programming capabilities.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\" id=\"How-to-Use-IDLE\"><strong>How to Use IDLE<\/strong><\/h2>\n\n\n\n<p>IDLE (Integrated Development and Learning Environment) is the default Python IDE that comes with the Python installation. It provides a simple environment to start coding in Python.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><strong>Starting IDLE<\/strong>:<\/h3>\n\n\n\n<p>1. <strong>Open IDLE<\/strong>: After installing Python, you can find IDLE in your operating system\u2019s application launcher. On Windows, it is listed in the Start Menu under Python. On macOS and Linux, you can search for IDLE in your applications.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1024\" height=\"813\" src=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/open-idle-from-start-menu.png?resize=1024%2C813&#038;ssl=1\" alt=\"A screenshot showing how to start the Python IDLE application from the application menu on a Windows machine.\" class=\"wp-image-91\" loading=\"lazy\" srcset=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/open-idle-from-start-menu.png?resize=1024%2C813&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/open-idle-from-start-menu.png?resize=300%2C238&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/open-idle-from-start-menu.png?resize=768%2C610&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/open-idle-from-start-menu.png?w=1148&amp;ssl=1 1148w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">opening IDLE from the start menu<\/figcaption><\/figure>\n\n\n\n<p>2. <strong>Launch IDLE<\/strong>: Click on the IDLE icon to open it. You will see the Python Shell (interpreter) window.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1024\" height=\"852\" src=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/idle-interpreter-mode.png?resize=1024%2C852&#038;ssl=1\" alt=\"A screenshot of Python IDLE application showing the interpreter mode. \" class=\"wp-image-92\" style=\"width:645px;height:auto\" loading=\"lazy\" srcset=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/idle-interpreter-mode.png?resize=1024%2C852&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/idle-interpreter-mode.png?resize=300%2C250&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/idle-interpreter-mode.png?resize=768%2C639&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/idle-interpreter-mode.png?w=1212&amp;ssl=1 1212w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">IDLE interpreter mode<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>Using the Interpreter Mode<\/strong><\/h2>\n\n\n\n<p>The Python Shell in IDLE allows you to enter and execute Python commands one line at a time. This is useful for testing small snippets of code and learning the basics of Python.<\/p>\n\n\n\n<p>1. <strong>Enter a Command<\/strong>: Type a Python command at the prompt (`&gt;&gt;&gt;`) and press Enter. For example, type `print(\u201cHello, World!\u201d)` and press Enter. You should see the output `Hello, World!`.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1024\" height=\"852\" src=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/print-hello-world-in-python-interpreter-mode.png?resize=1024%2C852&#038;ssl=1\" alt=\"Screenshot showing a 'Hello World' program in Python Interpreter mode in the IDLE application.\" class=\"wp-image-93\" loading=\"lazy\" srcset=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/print-hello-world-in-python-interpreter-mode.png?resize=1024%2C852&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/print-hello-world-in-python-interpreter-mode.png?resize=300%2C250&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/print-hello-world-in-python-interpreter-mode.png?resize=768%2C639&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/print-hello-world-in-python-interpreter-mode.png?w=1212&amp;ssl=1 1212w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">Running <code>print(\"Hello World\")<\/code> in the IDLE Interpreter Mode<\/figcaption><\/figure>\n\n\n\n<p>2. <strong>Experiment with Commands<\/strong>: You can try various commands and see the immediate results. This helps in understanding how different Python commands work.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>Creating and Running Scripts<\/strong><\/h2>\n\n\n\n<p>\u00a0IDLE also allows you to create and run Python scripts. This is useful for writing and testing more complex programs.<\/p>\n\n\n\n<p>1. Create a New File: In the IDLE menu, go to `File &gt; New File`. This opens a new window where you can write your Python code.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1024\" height=\"852\" src=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/Creating-new-file-in-IDLE.png?resize=1024%2C852&#038;ssl=1\" alt=\"Screenshot showing how to create a new script file in Python IDE.\" class=\"wp-image-94\" loading=\"lazy\" srcset=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/Creating-new-file-in-IDLE.png?resize=1024%2C852&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/Creating-new-file-in-IDLE.png?resize=300%2C250&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/Creating-new-file-in-IDLE.png?resize=768%2C639&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/Creating-new-file-in-IDLE.png?w=1212&amp;ssl=1 1212w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">Creating a New Script File in IDLE<\/figcaption><\/figure>\n\n\n\n<p>2. Write Your Script: Enter your Python code in the new file window. For example, write:<\/p>\n\n\n\n<p>print(\u201cHello  World\u201d)<\/p>\n\n\n\n<p>3. Save the File: Save your script by going to `File &gt; Save` or pressing `Ctrl+S` (Cmd+S on macOS). Choose a location and name for your file, making sure it has a `.py` extension (e.g., `hello_world.py`).<\/p>\n\n\n\n<p>4. Run the Script: To run your script, go to `Run &gt; Run Module` or press `F5`. The output of your script will be displayed in the Python Shell window.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1024\" height=\"900\" src=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/Running-a-python-script-in-IDLE.png?resize=1024%2C900&#038;ssl=1\" alt=\"Screenshot showing how to run a script in Python IDLE.\" class=\"wp-image-95\" loading=\"lazy\" srcset=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/Running-a-python-script-in-IDLE.png?resize=1024%2C900&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/Running-a-python-script-in-IDLE.png?resize=300%2C264&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/Running-a-python-script-in-IDLE.png?resize=768%2C675&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/Running-a-python-script-in-IDLE.png?w=1162&amp;ssl=1 1162w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">Running a Python Script in IDLE<\/figcaption><\/figure>\n\n\n\n<p>By using IDLE, you can easily start learning Python by experimenting with commands in the interpreter mode and writing scripts for more complex tasks.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-default\">\n\n\n\n<p><\/p>\n\n\n\n<p>In this chapter, we discussed how to install Python on different operating systems and introduced what an IDE is, along with some popular ones used for Python development. We also covered how to use IDLE, the default IDE that comes with Python, for running commands in the interpreter mode and creating scripts. In the next chapter, we will go through Python basics, including how to create variables and use the print function in the interpreter mode. Be sure to check out the next chapter for these fundamental concepts!<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\">\n\n\n\n<div class=\"table-of-contents\" style=\"background-color: #066095; color: white; padding: 10px; border-radius: 10px; margin-top: 20px; display: flex; justify-content: space-between; align-items: center; font-weight: 600;\">\n  <span style=\"flex: 1; text-align: left;\">\n    <a href=\"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-1-introduction-to-python-programming\" style=\"color: white; text-decoration: underline;\">\u25c0 Previous<\/a>\n  <\/span>\n  \n  <span style=\"flex: 1; text-align: center;\">\n    <a href=\"https:\/\/www.zframez.com\/articles\/python-tutorials\" style=\"color: white; text-decoration: underline;\">Python Tutorials<\/a>\n  <\/span>\n  \n  <span style=\"flex: 1; text-align: right;\">\n    <a href=\"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-3-working-with-variables-in-python\" style=\"color: white; text-decoration: underline;\">Next \u25b6<\/a>\n  <\/span>\n<\/div>\n\n\n\n\n<p><\/p>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>\u25c0 Previous Python Tutorials Next \u25b6 Before you can start writing and running Python code, you\u2019ll need to set up Python on your computer. In this chapter, we\u2019ll guide you through the process of installing Python on Windows, macOS, and Linux. We\u2019ll also explain what an Integrated Development Environment (IDE) is and help you pick [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":735,"comment_status":"open","ping_status":"open","sticky":false,"template":"wp-custom-template-post-with-sidebar2","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[46],"tags":[236,244,238,240,245,237,239,241,242,243],"class_list":["post-90","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-tutorials","tag-integrated-development-environment-ide","tag-python-environment-setup","tag-python-for-beginners","tag-python-ide","tag-python-idle","tag-python-installation","tag-python-on-linux","tag-python-on-macos","tag-python-on-windows","tag-setting-up-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Chapter 2: Setting Up Python - Tutorials<\/title>\n<meta name=\"description\" content=\"Learn how to set up Python on Windows, macOS, and Linux. This guide also covers IDEs to help you start coding in Python smoothly.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Step-by-Step Guide to Setting Up Python on Your System\" \/>\n<meta property=\"og:description\" content=\"Learn how to set up Python on Windows, macOS, and Linux. Follow this guide to get your Python environment ready for coding, no matter your operating system\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python\" \/>\n<meta property=\"og:site_name\" content=\"Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/zframez\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-04T18:06:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-16T14:51:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/download-and-install-python.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1872\" \/>\n\t<meta property=\"og:image:height\" content=\"778\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"sajith achipra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@zframez\" \/>\n<meta name=\"twitter:site\" content=\"@zframez\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"sajith achipra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/python-tutorials\\\/chapter-2-setting-up-python#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/python-tutorials\\\/chapter-2-setting-up-python\"},\"author\":{\"name\":\"sajith achipra\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#\\\/schema\\\/person\\\/8b3b88007644501771d2452d3cc80f41\"},\"headline\":\"Chapter 2: Setting Up Python\",\"datePublished\":\"2024-09-04T18:06:02+00:00\",\"dateModified\":\"2024-10-16T14:51:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/python-tutorials\\\/chapter-2-setting-up-python\"},\"wordCount\":1227,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/python-tutorials\\\/chapter-2-setting-up-python#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/download-and-install-python.png?fit=1872%2C778&ssl=1\",\"keywords\":[\"Integrated Development Environment (IDE)\",\"Python Environment Setup\",\"Python for Beginners\",\"Python IDE\",\"Python IDLE\",\"Python Installation\",\"Python on Linux\",\"Python on macOS\",\"Python on Windows\",\"Setting up Python\"],\"articleSection\":[\"python tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.zframez.com\\\/articles\\\/python-tutorials\\\/chapter-2-setting-up-python#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/python-tutorials\\\/chapter-2-setting-up-python\",\"url\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/python-tutorials\\\/chapter-2-setting-up-python\",\"name\":\"Chapter 2: Setting Up Python - Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/python-tutorials\\\/chapter-2-setting-up-python#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/python-tutorials\\\/chapter-2-setting-up-python#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/download-and-install-python.png?fit=1872%2C778&ssl=1\",\"datePublished\":\"2024-09-04T18:06:02+00:00\",\"dateModified\":\"2024-10-16T14:51:09+00:00\",\"description\":\"Learn how to set up Python on Windows, macOS, and Linux. This guide also covers IDEs to help you start coding in Python smoothly.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/python-tutorials\\\/chapter-2-setting-up-python#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.zframez.com\\\/articles\\\/python-tutorials\\\/chapter-2-setting-up-python\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/python-tutorials\\\/chapter-2-setting-up-python#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/download-and-install-python.png?fit=1872%2C778&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/download-and-install-python.png?fit=1872%2C778&ssl=1\",\"width\":1872,\"height\":778,\"caption\":\"Official Python download page for setting up Python on your system\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/python-tutorials\\\/chapter-2-setting-up-python#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Tutorials\",\"item\":\"https:\\\/\\\/www.zframez.com\\\/articles\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chapter 2: Setting Up Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#website\",\"url\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/\",\"name\":\"zframez tutorials\",\"description\":\"Learn networking bit by bit\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#organization\",\"name\":\"zframez technologies\",\"url\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/zframez-logo.jpg?fit=864%2C864&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/zframez-logo.jpg?fit=864%2C864&ssl=1\",\"width\":864,\"height\":864,\"caption\":\"zframez technologies\"},\"image\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/zframez\\\/\",\"https:\\\/\\\/x.com\\\/zframez\",\"https:\\\/\\\/www.instagram.com\\\/zframez_technologies\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#\\\/schema\\\/person\\\/8b3b88007644501771d2452d3cc80f41\",\"name\":\"sajith achipra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g\",\"caption\":\"sajith achipra\"},\"sameAs\":[\"http:\\\/\\\/www.zframez.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Chapter 2: Setting Up Python - Tutorials","description":"Learn how to set up Python on Windows, macOS, and Linux. This guide also covers IDEs to help you start coding in Python smoothly.","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:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python","og_locale":"en_US","og_type":"article","og_title":"Step-by-Step Guide to Setting Up Python on Your System","og_description":"Learn how to set up Python on Windows, macOS, and Linux. Follow this guide to get your Python environment ready for coding, no matter your operating system","og_url":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python","og_site_name":"Tutorials","article_publisher":"https:\/\/www.facebook.com\/zframez\/","article_published_time":"2024-09-04T18:06:02+00:00","article_modified_time":"2024-10-16T14:51:09+00:00","og_image":[{"width":1872,"height":778,"url":"https:\/\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/download-and-install-python.png","type":"image\/png"}],"author":"sajith achipra","twitter_card":"summary_large_image","twitter_creator":"@zframez","twitter_site":"@zframez","twitter_misc":{"Written by":"sajith achipra","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python#article","isPartOf":{"@id":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python"},"author":{"name":"sajith achipra","@id":"https:\/\/www.zframez.com\/articles\/#\/schema\/person\/8b3b88007644501771d2452d3cc80f41"},"headline":"Chapter 2: Setting Up Python","datePublished":"2024-09-04T18:06:02+00:00","dateModified":"2024-10-16T14:51:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python"},"wordCount":1227,"commentCount":0,"publisher":{"@id":"https:\/\/www.zframez.com\/articles\/#organization"},"image":{"@id":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/download-and-install-python.png?fit=1872%2C778&ssl=1","keywords":["Integrated Development Environment (IDE)","Python Environment Setup","Python for Beginners","Python IDE","Python IDLE","Python Installation","Python on Linux","Python on macOS","Python on Windows","Setting up Python"],"articleSection":["python tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python","url":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python","name":"Chapter 2: Setting Up Python - Tutorials","isPartOf":{"@id":"https:\/\/www.zframez.com\/articles\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python#primaryimage"},"image":{"@id":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/download-and-install-python.png?fit=1872%2C778&ssl=1","datePublished":"2024-09-04T18:06:02+00:00","dateModified":"2024-10-16T14:51:09+00:00","description":"Learn how to set up Python on Windows, macOS, and Linux. This guide also covers IDEs to help you start coding in Python smoothly.","breadcrumb":{"@id":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python#primaryimage","url":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/download-and-install-python.png?fit=1872%2C778&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/download-and-install-python.png?fit=1872%2C778&ssl=1","width":1872,"height":778,"caption":"Official Python download page for setting up Python on your system"},{"@type":"BreadcrumbList","@id":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-2-setting-up-python#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Tutorials","item":"https:\/\/www.zframez.com\/articles"},{"@type":"ListItem","position":2,"name":"Chapter 2: Setting Up Python"}]},{"@type":"WebSite","@id":"https:\/\/www.zframez.com\/articles\/#website","url":"https:\/\/www.zframez.com\/articles\/","name":"zframez tutorials","description":"Learn networking bit by bit","publisher":{"@id":"https:\/\/www.zframez.com\/articles\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.zframez.com\/articles\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.zframez.com\/articles\/#organization","name":"zframez technologies","url":"https:\/\/www.zframez.com\/articles\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.zframez.com\/articles\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/zframez-logo.jpg?fit=864%2C864&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/zframez-logo.jpg?fit=864%2C864&ssl=1","width":864,"height":864,"caption":"zframez technologies"},"image":{"@id":"https:\/\/www.zframez.com\/articles\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/zframez\/","https:\/\/x.com\/zframez","https:\/\/www.instagram.com\/zframez_technologies\/"]},{"@type":"Person","@id":"https:\/\/www.zframez.com\/articles\/#\/schema\/person\/8b3b88007644501771d2452d3cc80f41","name":"sajith achipra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g","caption":"sajith achipra"},"sameAs":["http:\/\/www.zframez.com"]}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/download-and-install-python.png?fit=1872%2C778&ssl=1","jetpack-related-posts":[{"id":83,"url":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-1-introduction-to-python-programming","url_meta":{"origin":90,"position":0},"title":"Chapter 1: Introduction to Python Programming","author":"sajith achipra","date":"September 4, 2024","format":false,"excerpt":"\u25c0 Previous Python Tutorials Next \u25b6 In this Python tutorial, we'll explore Python's origins, key milestones, and its standout features and benefits. Whether you're new to programming or looking to expand your skills, this guide will provide you with a solid foundation in Python. If you want to understand why\u2026","rel":"","context":"In &quot;python tutorials&quot;","block_context":{"text":"python tutorials","link":"https:\/\/www.zframez.com\/articles\/category\/python-tutorials"},"img":{"alt_text":"Table filled with Python-related materials, including a computer displaying Python code, a Python textbook, and notes about Python","src":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/working-with-python.webp?fit=1024%2C1024&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/working-with-python.webp?fit=1024%2C1024&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/working-with-python.webp?fit=1024%2C1024&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/working-with-python.webp?fit=1024%2C1024&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":901,"url":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-6-python-while-and-for-loops-examples-and-explanations","url_meta":{"origin":90,"position":1},"title":"Chapter 6: Python While and For Loops: Examples and Explanations","author":"sajith achipra","date":"September 15, 2024","format":false,"excerpt":"\u25c0 Previous Python Tutorials Next \u25b6 Python While and For Loops In this chapter of our Python tutorial series, we will explore two essential looping structures in Python: while loops and for loops. Loops are a fundamental part of programming, allowing you to execute a block of code repeatedly under\u2026","rel":"","context":"In &quot;python tutorials&quot;","block_context":{"text":"python tutorials","link":"https:\/\/www.zframez.com\/articles\/category\/python-tutorials"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":904,"url":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-7-working-with-strings-in-python","url_meta":{"origin":90,"position":2},"title":"Chapter 7: Working with Strings in Python","author":"sajith achipra","date":"September 15, 2024","format":false,"excerpt":"\u25c0 Previous Python Tutorials Next \u25b6 Python String Manipulation: Methods and Examples In Chapter 7, we\u2019ll be looking at how to work with strings in Python. Strings are used everywhere in programming, and Python provides a lot of methods to make string manipulation easy. In this chapter, we\u2019ll explore methods\u2026","rel":"","context":"In &quot;python tutorials&quot;","block_context":{"text":"python tutorials","link":"https:\/\/www.zframez.com\/articles\/category\/python-tutorials"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":908,"url":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-8-python-lists-and-tuples-operations-and-methods","url_meta":{"origin":90,"position":3},"title":"Chapter 8: Python Lists and Tuples -Operations and Methods","author":"sajith achipra","date":"September 15, 2024","format":false,"excerpt":"\u25c0 Previous Python Tutorials Next \u25b6 Working with Lists and Tuples in Python In this chapter, we\u2019ll explore two important data structures in Python: lists and tuples. Lists allow you to store a collection of items that can be modified, while tuples are immutable, meaning their elements cannot be changed.\u2026","rel":"","context":"In &quot;python tutorials&quot;","block_context":{"text":"python tutorials","link":"https:\/\/www.zframez.com\/articles\/category\/python-tutorials"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":98,"url":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-3-working-with-variables-in-python","url_meta":{"origin":90,"position":4},"title":"Chapter 3: Working with Variables in Python","author":"sajith achipra","date":"September 4, 2024","format":false,"excerpt":"\u25c0 Previous Python Tutorials Next \u25b6 In Python, variables are one of the fundamental concepts you'll work with. They allow you to store data that your programs can manipulate and use. In this chapter, we\u2019ll explore what variables are, how to check the Python version you\u2019re using, and the different\u2026","rel":"","context":"In &quot;python tutorials&quot;","block_context":{"text":"python tutorials","link":"https:\/\/www.zframez.com\/articles\/category\/python-tutorials"},"img":{"alt_text":"Computer displaying a program, with a book and pen on the table, representing learning and coding in Python.","src":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/Understanding-Python-variables.jpg?fit=684%2C457&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/Understanding-Python-variables.jpg?fit=684%2C457&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/Understanding-Python-variables.jpg?fit=684%2C457&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":751,"url":"https:\/\/www.zframez.com\/articles\/python-tutorials\/chapter-5-python-conditional-statements-if-else-and-elif","url_meta":{"origin":90,"position":5},"title":"Chapter 5:Python Conditional Statements: if, else, and elif","author":"sajith achipra","date":"September 11, 2024","format":false,"excerpt":"\u25c0 Previous Python Tutorials Next \u25b6 Table of Contents Introduction to Python `if` and `else` Understanding Python `if` Syntax Multiple Lines of Code in an `if` Statement Using `else` with `if` How does Python know when the `if` code block is finished? Using the `pass` Statement Checking Odd and Even\u2026","rel":"","context":"In &quot;python tutorials&quot;","block_context":{"text":"python tutorials","link":"https:\/\/www.zframez.com\/articles\/category\/python-tutorials"},"img":{"alt_text":"Block diagram illustrating an if expression and corresponding code block in Python, with a Python icon in the top right corner.","src":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/Python-conditional-statments-if-else.jpg?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/Python-conditional-statments-if-else.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/Python-conditional-statments-if-else.jpg?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/Python-conditional-statments-if-else.jpg?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/09\/Python-conditional-statments-if-else.jpg?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/posts\/90","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/comments?post=90"}],"version-history":[{"count":4,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/posts\/90\/revisions"}],"predecessor-version":[{"id":1077,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/posts\/90\/revisions\/1077"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/media\/735"}],"wp:attachment":[{"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/media?parent=90"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/categories?post=90"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/tags?post=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}