{"id":24,"date":"2026-06-29T08:38:53","date_gmt":"2026-06-29T08:38:53","guid":{"rendered":"https:\/\/algovelgo.com\/?p=24"},"modified":"2026-06-29T08:38:53","modified_gmt":"2026-06-29T08:38:53","slug":"lesson-2-variables-and-data-types","status":"publish","type":"post","link":"https:\/\/algovelgo.com\/?p=24","title":{"rendered":"Lesson 2: Variables and Data Types"},"content":{"rendered":"<h2>Storing Information<\/h2>\n<p>In Python, variables are created the moment you first assign a value to them. There are no command words like <code>var<\/code> or <code>let<\/code>.<\/p>\n<h3>1. Creating Variables<\/h3>\n<pre><code class=\"language-python\"># Defining variables\nage = 25\nname = \"Alice\"\nis_student = True\n<\/code><\/pre>\n<h3>2. Basic Data Types<\/h3>\n<p>Python has several built-in data types that you will use frequently:<\/p>\n<ul>\n<li><strong>Integers (int):<\/strong> Whole numbers like <code>10<\/code> or <code>-5<\/code>.<\/li>\n<li><strong>Floats (float):<\/strong> Decimal numbers like <code>3.14<\/code>.<\/li>\n<li><strong>Strings (str):<\/strong> Text data enclosed in quotes like <code>\"CrackTheLogic\"<\/code>.<\/li>\n<li><strong>Booleans (bool):<\/strong> Represents <code>True<\/code> or <code>False<\/code>.<\/li>\n<\/ul>\n<h3>3. Checking Types<\/h3>\n<p>You can check the type of any variable using the <code>type()<\/code> function:<\/p>\n<pre><code class=\"language-python\">score = 99.5\nprint(type(score))  # Output: &lt;class 'float'&gt;\n<\/code><\/pre>\n<p>In the next lesson, we will explore lists and loops!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Storing Information In Python, variables are created the moment you first assign a value to them. There are no command words like var or let. 1. Creating Variables # Defining variables age = 25 name = &#8220;Alice&#8221; is_student = True 2. Basic Data Types Python has several built-in data types that you will use frequently: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/algovelgo.com\/index.php?rest_route=\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/algovelgo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/algovelgo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/algovelgo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/algovelgo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=24"}],"version-history":[{"count":0,"href":"https:\/\/algovelgo.com\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions"}],"wp:attachment":[{"href":"https:\/\/algovelgo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/algovelgo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/algovelgo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}