{"id":312,"date":"2025-12-17T10:06:16","date_gmt":"2025-12-17T10:06:16","guid":{"rendered":"https:\/\/codetypingpro.com\/?p=312"},"modified":"2025-12-17T11:34:33","modified_gmt":"2025-12-17T11:34:33","slug":"lesson-1-introduction-to-python-examples","status":"publish","type":"post","link":"https:\/\/codetypingpro.com\/?p=312","title":{"rendered":"\ud83d\udcd8 Lesson 1 examples: Introduction to Python"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Here are <strong>more beginner-friendly examples for Lesson 1: Introduction to Python<\/strong>, with clear explanations and practical use cases. These are perfect if you\u2019re just starting or teaching Python basics.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">1\ufe0f\u20e3 Python as a Calculator<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>print(10 + 5)\nprint(20 - 7)\nprint(4 * 6)\nprint(20 \/ 4)\nprint(10 % 3)   # Remainder\nprint(2 ** 3)   # Power\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>15\n13\n24\n5.0\n1\n8\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2\ufe0f\u20e3 Printing Multiple Values<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>name = \"Ali\"\nage = 25\ncity = \"Delhi\"\n\nprint(name, age, city)\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Ali 25 Delhi\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3\ufe0f\u20e3 Using <code>type()<\/code> to Check Data Type<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>x = 10\ny = 3.5\nz = \"Python\"\nis_active = True\n\nprint(type(x))\nprint(type(y))\nprint(type(z))\nprint(type(is_active))\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">4\ufe0f\u20e3 Simple Variable Usage<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>price = 100\nquantity = 3\ntotal = price * quantity\n\nprint(\"Total price:\", total)\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">5\ufe0f\u20e3 String Examples<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>message = \"Welcome to Python\"\nprint(message.upper())\nprint(message.lower())\nprint(message&#91;0])\nprint(message&#91;-1])\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">6\ufe0f\u20e3 Taking User Input<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>name = input(\"Enter your name: \")\nprint(\"Hello\", name)\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">7\ufe0f\u20e3 Converting Input Data Type<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>age = int(input(\"Enter your age: \"))\nprint(\"Next year you will be\", age + 1)\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">8\ufe0f\u20e3 Simple Program: Student Info<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>name = input(\"Enter student name: \")\nmarks = int(input(\"Enter marks: \"))\n\nprint(\"Student:\", name)\nprint(\"Marks:\", marks)\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">9\ufe0f\u20e3 Comments in Python<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># This is a single-line comment\n\n\"\"\"\nThis is a\nmulti-line\ncomment\n\"\"\"\nprint(\"Comments example\")\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd1f Python Is Case-Sensitive<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>name = \"Python\"\nName = \"Programming\"\n\nprint(name)\nprint(Name)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here are more beginner-friendly examples for Lesson 1: Introduction to Python, with clear explanations and practical use cases. These are perfect if you\u2019re just starting or teaching Python basics. 1\ufe0f\u20e3 Python as a Calculator Output 2\ufe0f\u20e3 Printing Multiple Values Output 3\ufe0f\u20e3 Using type() to Check Data Type 4\ufe0f\u20e3 Simple Variable Usage 5\ufe0f\u20e3 String Examples 6\ufe0f\u20e3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,1],"tags":[],"class_list":["post-312","post","type-post","status-publish","format-standard","hentry","category-python-easy-course-examples","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/posts\/312","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=312"}],"version-history":[{"count":3,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/posts\/312\/revisions"}],"predecessor-version":[{"id":349,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/posts\/312\/revisions\/349"}],"wp:attachment":[{"href":"https:\/\/codetypingpro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}