{"id":11,"date":"2025-10-19T02:44:37","date_gmt":"2025-10-19T02:44:37","guid":{"rendered":"https:\/\/codetypingpro.com\/?p=11"},"modified":"2025-12-17T10:10:34","modified_gmt":"2025-12-17T10:10:34","slug":"lesson-1-introduction-to-python","status":"publish","type":"post","link":"https:\/\/codetypingpro.com\/?p=11","title":{"rendered":"Lesson 1: Introduction to Python"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83c\udfaf <strong>Lesson Objective<\/strong><\/h3>\n\n\n\n<p>By the end of this lesson, you\u2019ll understand:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>What Python is and where it\u2019s used<\/li>\n\n\n\n<li>How to install and run Python<\/li>\n\n\n\n<li>Basic syntax, keywords, and comments<\/li>\n\n\n\n<li>Writing and running your first Python program<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcd8 <strong>1. What is Python?<\/strong><\/h3>\n\n\n\n<p><strong>Python<\/strong> is a high-level, interpreted programming language known for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Simple and readable syntax<\/li>\n\n\n\n<li>Wide use in web development, data science, automation, and AI<\/li>\n\n\n\n<li>Huge community and open-source support<\/li>\n<\/ul>\n\n\n\n<p><strong>Created by:<\/strong> Guido van Rossum (in 1991)<br><strong>Current versions:<\/strong> Python 3.x (Python 3.12 is latest as of 2025)<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udca1 <strong>2. Why Learn Python?<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Reason<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\ud83e\udde0 Easy to Learn<\/td><td>Clean syntax, beginner-friendly<\/td><\/tr><tr><td>\u2699\ufe0f Versatile<\/td><td>Used in data science, AI, web, scripting<\/td><\/tr><tr><td>\ud83d\udcca Libraries<\/td><td>Supports powerful tools like NumPy, Pandas, Django<\/td><\/tr><tr><td>\ud83d\udcbc Career<\/td><td>In-demand skill in IT, automation, analytics<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2699\ufe0f <strong>3. Setting Up Python<\/strong><\/h3>\n\n\n\n<p><strong>Step 1:<\/strong> Download from <a href=\"https:\/\/www.python.org\/downloads\/\">https:\/\/www.python.org\/downloads\/<\/a><br><strong>Step 2:<\/strong> Check the box \u201cAdd Python to PATH\u201d during installation.<br><strong>Step 3:<\/strong> Verify installation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python --version\n<\/code><\/pre>\n\n\n\n<p><strong>Output Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Python 3.12.2\n<\/code><\/pre>\n\n\n\n<p><strong>Step 4:<\/strong> Open an IDE (like VS Code, PyCharm, or IDLE) to start coding.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\udde9 <strong>4. Your First Python Program<\/strong><\/h3>\n\n\n\n<p>Let\u2019s print your first message \ud83d\udc47<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># My first Python program\nprint(\"Hello, Python World!\")\n<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Hello, Python World!\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\udde0 <strong>5. Understanding Python Syntax<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Concept<\/th><th>Example<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><strong>Case Sensitive<\/strong><\/td><td><code>Name<\/code> \u2260 <code>name<\/code><\/td><td>Python differentiates between uppercase and lowercase<\/td><\/tr><tr><td><strong>Indentation<\/strong><\/td><td><code>if True:<\/code><br><code>print(\"Yes\")<\/code><\/td><td>Uses spaces (not braces) to define code blocks<\/td><\/tr><tr><td><strong>Comments<\/strong><\/td><td><code># This is a comment<\/code><\/td><td>Comments are ignored by Python interpreter<\/td><\/tr><tr><td><strong>Multiline Comment<\/strong><\/td><td><code>''' comment '''<\/code><\/td><td>Used for longer notes or documentation<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcca <strong>6. Python Keywords<\/strong><\/h3>\n\n\n\n<p>Reserved words used by Python \u2014 you can\u2019t use them as variable names.<\/p>\n\n\n\n<p>Examples:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>and, as, assert, break, class, continue, def, del, elif,\nelse, except, False, finally, for, from, global, if,\nimport, in, is, lambda, None, not, or, pass, raise,\nreturn, True, try, while, with, yield\n<\/code><\/pre>\n\n\n\n<p>Try viewing all Python keywords:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import keyword\nprint(keyword.kwlist)\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcbb <strong>7. Interactive Example: Simple Calculator<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Simple addition program\nnum1 = int(input(\"Enter first number: \"))\nnum2 = int(input(\"Enter second number: \"))\n\nresult = num1 + num2\nprint(\"The sum is:\", result)\n<\/code><\/pre>\n\n\n\n<p><strong>Example Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Enter first number: 10\nEnter second number: 5\nThe sum is: 15\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddea <strong>8. Practice Tasks<\/strong><\/h3>\n\n\n\n<p>\u2705 <strong>Task 1:<\/strong> Write a program to print your name and favorite hobby.<br>\u2705 <strong>Task 2:<\/strong> Write a Python program that prints:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Welcome to Python Programming!\n<\/code><\/pre>\n\n\n\n<p>\u2705 <strong>Task 3:<\/strong> Write a Python program to perform subtraction of two numbers given by the user.<br>\u2705 <strong>Task 4:<\/strong> Add a comment above each line explaining what it does.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddf1 <strong>9. Summary<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Topic<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>Language Type<\/td><td>Interpreted, high-level<\/td><\/tr><tr><td>Key Function<\/td><td><code>print()<\/code><\/td><\/tr><tr><td>Code Block<\/td><td>Defined by indentation<\/td><\/tr><tr><td>Comments<\/td><td><code># single line<\/code>, <code>''' multi-line '''<\/code><\/td><\/tr><tr><td>First Step<\/td><td>Install and verify Python 3<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83c\udfc1 <strong>10. Assignment (Mini Project)<\/strong><\/h3>\n\n\n\n<p><strong>Project:<\/strong> \u201cPersonal Info Display\u201d<br>Write a small Python script that prints:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Your name<\/li>\n\n\n\n<li>Your favorite language<\/li>\n\n\n\n<li>Your goal for learning Python<\/li>\n<\/ul>\n\n\n\n<p><strong>Example Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>My name is Sameer Pasha.\nMy favorite programming language is Python.\nMy goal is to become a professional Python developer!\n<\/code><\/pre>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-28e8a1fd-9c52-4d2e-8fb9-0d1638e6f84e\" href=\"https:\/\/codetypingpro.com\/wp-content\/uploads\/2025\/10\/Lesson_1_Introduction_to_Python_Practice_Sheet-1.docx\">Lesson_1_Introduction_to_Python_Practice_Sheet<\/a><a href=\"https:\/\/codetypingpro.com\/wp-content\/uploads\/2025\/10\/Lesson_1_Introduction_to_Python_Practice_Sheet-1.docx\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-28e8a1fd-9c52-4d2e-8fb9-0d1638e6f84e\">Download<\/a><\/div>\n\n\n\n<p><a href=\"https:\/\/codetypingpro.com\/?p=312\" data-type=\"link\" data-id=\"https:\/\/codetypingpro.com\/?p=312\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">More examples<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud83c\udfaf Lesson Objective By the end of this lesson, you\u2019ll understand: \ud83d\udcd8 1. What is Python? Python is a high-level, interpreted programming language known for: Created by: Guido van Rossum (in 1991)Current versions: Python 3.x (Python 3.12 is latest as of 2025) \ud83d\udca1 2. Why Learn Python? Reason Description \ud83e\udde0 Easy to Learn Clean syntax, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,1],"tags":[],"class_list":["post-11","post","type-post","status-publish","format-standard","hentry","category-python-easy-course-outline","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/posts\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11"}],"version-history":[{"count":2,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":316,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions\/316"}],"wp:attachment":[{"href":"https:\/\/codetypingpro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}