{"id":1454,"date":"2022-11-16T20:00:00","date_gmt":"2022-11-16T11:00:00","guid":{"rendered":"https:\/\/python-academia.com\/en\/?p=1454"},"modified":"2022-09-23T23:35:09","modified_gmt":"2022-09-23T14:35:09","slug":"python-variable","status":"publish","type":"post","link":"https:\/\/python-academia.com\/en\/python-variable\/","title":{"rendered":"[Python Variable]Name Convention, how to check data type etc."},"content":{"rendered":"\n<p>This article shows <span class=\"st-mymarker-s\">basics of variables in Python<\/span>.<\/p>\n\n\n\n<p>Proper understanding of variable naming conventions improves code readability.<\/p>\n\n\n\n<div class=\"wp-block-st-blocks-midashi-box freebox has-title\" style=\"background-color:#eceff1;border-color:#263238;border-radius:0 5px 5px 5px\"><p class=\"p-free\" style=\"border-color:#263238;font-weight:bold\"><span class=\"p-entry-f\" style=\"color:#ffffff;font-weight:bold;background-color:#263238;border-radius:0 0 5px 0\"><i class=\"st-fa st-svg-file-text-o st-css-no\" aria-hidden=\"\"><\/i>Contents<\/span><\/p><div class=\"free-inbox\">\n<p><\/p>\n\n\n\n<ul><li>Variable name conventions in Python<\/li><li>Prohibitions of Variable name<\/li><li>Variable Declaration in Python<\/li><li>Variable types<\/li><li>How to check variable types<\/li><li>How to convert variable types<\/li><li>\u3010Appendix\u3011Naming Conventions other than variable<\/li><\/ul>\n\n\n\n<p><\/p>\n<\/div><\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Variable name conventions in Python<\/h2>\n\n\n\n<p>In the beginning, I show <span class=\"st-mymarker-s\">variable name convention in Python<\/span>.<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Basics of variable name conventions<\/h3>\n\n\n\n<p>The following three types of characters can be used in the variable name.<\/p>\n\n\n\n<p class=\"is-style-st-paragraph-memo\">\u30fbAlphabet<br>\u30fbNumbers<br>\u30fb&#8217;_&#8217;  :  Underscore<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Examples of variable names are as follows<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers language-Python\"><code>test = 100\ntest1 = 100\ntest_1 = 100<\/code><\/pre>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Simple, but this is the only variable name conventions.<\/p>\n\n\n\n<p>Variable names must be determined while following these conventions and avoiding prohibitions.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p style=\"color:#666;margin-bottom:5px;\">sponsored link<\/p>\n\n<table>\n<tbody>\n<tr>\n<td>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6354467409705666\"\n     crossorigin=\"anonymous\"><\/script>\n<!-- py-article-doubleA -->\n<ins class=\"adsbygoogle\"\n     style=\"display:inline-block;width:336px;height:300px\"\n     data-ad-client=\"ca-pub-6354467409705666\"\n     data-ad-slot=\"1820454727\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n<\/td>\n\n<td>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6354467409705666\"\n     crossorigin=\"anonymous\"><\/script>\n<!-- py-article-doubleB -->\n<ins class=\"adsbygoogle\"\n     style=\"display:inline-block;width:336px;height:300px\"\n     data-ad-client=\"ca-pub-6354467409705666\"\n     data-ad-slot=\"3395043238\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">Prohibitions of Variable name<\/h2>\n\n\n\n<p>There are<span class=\"st-mymarker-s\"> three main prohibitions on naming variables<\/span>.<\/p>\n\n\n\n<p class=\"is-style-st-paragraph-memo\">\u30fbCannot use &#8220;number&#8221; at the &#8220;beginning&#8221; of a variable<br>\u30fbCannot use Reserved Keywords<br>\u30fbCannot use Symbols<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>I show these three prohibitions in order.<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">&#8212; Cannot use &#8220;number&#8221; at the &#8220;beginning&#8221; of a variable &#8212;<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>### syntax error\n1a = 100<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">&#8212; Cannot use Reserved Keywords &#8212;<\/h4>\n\n\n\n<p>&#8220;if&#8221;, &#8220;for&#8221;, and other strings that are reserved keywords in Python cannot be specified as variable names.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>### syntax error\nif = 1<\/code><\/pre>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The following are examples of reserved keywords that cannot be used as variable names.<\/p>\n\n\n\n<p class=\"is-style-st-paragraph-memo\">if<br>True<br>import<br>as<br>return<br>not<br>etc.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">&#8212; Cannot use Symbols &#8212;<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>### error\na&amp;b = 1<\/code><\/pre>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The following are examples of symbols that cannot be used as variable names.<\/p>\n\n\n\n<p class=\"is-style-st-paragraph-memo\">@<br>.<br>+<br>&#8211;<br>*<br>%<br>\/<br>etc.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p style=\"color:#666;margin-bottom:5px;\">sponsored link<\/p>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6354467409705666\"\n     crossorigin=\"anonymous\"><\/script>\n<!-- py-article-display -->\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-6354467409705666\"\n     data-ad-slot=\"6239864271\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Variable Declaration in Python<\/h2>\n\n\n\n<p>Other programming languages, such as C, require &#8220;variable declaration and variable type declaration&#8221; when using variables.<\/p>\n\n\n\n<p><span class=\"st-mymarker-s\">Python, however, does not require this &#8220;variable declaration&#8221;<\/span>.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>In Python, the type of variable is automatically determined.<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Comparison of variable declaration in C and Python<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">&#8212; C &#8212;<\/h4>\n\n\n\n<p class=\"is-style-st-paragraph-memo\">int a<br>a = 1<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">&#8212; Python &#8212;<\/h4>\n\n\n\n<p class=\"is-style-st-paragraph-memo\">a = 1<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Python is easier.<\/p>\n\n\n\n<p>However, be aware that dynamic variable declaration in python can also cause bugs.<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Examples of bugs in Python<\/h3>\n\n\n\n<p>Here is an example of a bug caused by dynamic variable declaration in Python.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Variables of numeric type are overwritten with string.<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers language-Python\"><code>num = 100\nfruit = 'Apple'\n\nnum = fruit\n\nsum = num + 1\n# &gt;&gt; TypeError: can only concatenate str (not \"int\") to str<\/code><\/pre>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>&#8220;num&#8221; was initially variable of numeric type, but has become string type in the process.<\/p>\n\n\n\n<p>Therefore, addition will cause &#8220;TypeError&#8221;.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p style=\"color:#666;margin-bottom:5px;\">sponsored link<\/p>\n\n<table>\n<tbody>\n<tr>\n<td>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6354467409705666\"\n     crossorigin=\"anonymous\"><\/script>\n<!-- py-article-doubleA -->\n<ins class=\"adsbygoogle\"\n     style=\"display:inline-block;width:336px;height:300px\"\n     data-ad-client=\"ca-pub-6354467409705666\"\n     data-ad-slot=\"1820454727\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n<\/td>\n\n<td>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6354467409705666\"\n     crossorigin=\"anonymous\"><\/script>\n<!-- py-article-doubleB -->\n<ins class=\"adsbygoogle\"\n     style=\"display:inline-block;width:336px;height:300px\"\n     data-ad-client=\"ca-pub-6354467409705666\"\n     data-ad-slot=\"3395043238\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">Variable types<\/h2>\n\n\n\n<p>Here are the main data types in Python.<\/p>\n\n\n\n<table id=\"tablepress-3\" class=\"tablepress tablepress-id-3\">\n<thead>\n<tr class=\"row-1 odd\">\n\t<th colspan=\"2\" class=\"column-1\">Data Type<\/th><th class=\"column-3\">Description<\/th><th class=\"column-4\">Example<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-hover\">\n<tr class=\"row-2 even\">\n\t<td rowspan=\"3\" class=\"column-1\">Numeric<\/td><td class=\"column-2\">Interger<\/td><td class=\"column-3\">Numeric type without decimal point<\/td><td class=\"column-4\">num = 100<\/td>\n<\/tr>\n<tr class=\"row-3 odd\">\n\t<td class=\"column-2\">float<\/td><td class=\"column-3\">Numeric type with decimal point<\/td><td class=\"column-4\">num = 1.14<\/td>\n<\/tr>\n<tr class=\"row-4 even\">\n\t<td class=\"column-2\">Complex number<\/td><td class=\"column-3\">Denote imaginary units with j<\/td><td class=\"column-4\">a = 1 + 2j<\/td>\n<\/tr>\n<tr class=\"row-5 odd\">\n\t<td rowspan=\"3\" class=\"column-1\">Sequence Type<\/td><td class=\"column-2\">Strings<\/td><td class=\"column-3\">enclose with ' ' or \" \"<\/td><td class=\"column-4\">fruit = 'Apple'<\/td>\n<\/tr>\n<tr class=\"row-6 even\">\n\t<td class=\"column-2\">Tuple<\/td><td class=\"column-3\">\u30fbDefined with ( )<br \/>\n\u30fbSeparate with ,<br \/>\n\u30fbElements cannot be changed.<\/td><td class=\"column-4\">(1, 2, 3)<\/td>\n<\/tr>\n<tr class=\"row-7 odd\">\n\t<td class=\"column-2\">List<\/td><td class=\"column-3\">\u30fbDefined with [ ]<br \/>\n\u30fbSeparate with ,<br \/>\n\u30fbElements can be changed.<\/td><td class=\"column-4\">[1, 2, 3]<\/td>\n<\/tr>\n<tr class=\"row-8 even\">\n\t<td colspan=\"2\" class=\"column-1\">Set<\/td><td class=\"column-3\">\u30fbDefined with { }<br \/>\n\u30fbDuplicate elements are ignored.<br \/>\n\u30fbElements are not ordered.<\/td><td class=\"column-4\">set1 = {1, 2, 3, 3, 1, 2}<br \/>\nprint(set1)<br \/>\n# {1, 2, 3}<\/td>\n<\/tr>\n<tr class=\"row-9 odd\">\n\t<td colspan=\"2\" class=\"column-1\">Dictionary<\/td><td class=\"column-3\">\u30fbDefined with { }<br \/>\n\u30fbCombination of key and value<\/td><td class=\"column-4\">price = {\"apple\":100,<br \/>\n\"banana\":200,<br \/>\n\"orange\" : 100}<\/td>\n<\/tr>\n<tr class=\"row-10 even\">\n\t<td colspan=\"2\" class=\"column-1\">Boolean<\/td><td class=\"column-3\">\u30fbTrue, False<\/td><td class=\"column-4\">is_ok = True<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-3 from cache -->\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>I give a supplementary explanation about sequence type.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Sequence type is the type that stores multiple elements.<\/p>\n\n\n\n<p>String type is also a member of the sequence type since it contains multiple characters.<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers language-Python\"><code>fluit = 'Apple'\nfor char in fluit :\n    print(char)\n \n###Output###\n#A\n#p\n#p\n#l\n#e<\/code><\/pre>\n\n\n\n<p>The elements of the string &#8220;Apple&#8221; are taken one by one and displayed.<\/p>\n\n\n\n<p>You can see that string type is also sequence type because the elements can be taken out one by one.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p style=\"color:#666;margin-bottom:5px;\">sponsored link<\/p>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6354467409705666\"\n     crossorigin=\"anonymous\"><\/script>\n<!-- py-article-display -->\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-6354467409705666\"\n     data-ad-slot=\"6239864271\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\">How to check variable types<\/h2>\n\n\n\n<p>The data type can be checked by using type() function.<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers language-Python\"><code>num = 100\nfruit = 'Apple'\nis_ok = True\n\n\nprint(num, type(num))\nprint(fruit, type(fruit))\nprint(is_ok, type(is_ok))\n\n###Output###\n# 100 &lt;class 'int'&gt;\n# Apple &lt;class 'str'&gt;\n# True &lt;class 'bool'&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p style=\"color:#666;margin-bottom:5px;\">sponsored link<\/p>\n\n<table>\n<tbody>\n<tr>\n<td>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6354467409705666\"\n     crossorigin=\"anonymous\"><\/script>\n<!-- py-article-doubleA -->\n<ins class=\"adsbygoogle\"\n     style=\"display:inline-block;width:336px;height:300px\"\n     data-ad-client=\"ca-pub-6354467409705666\"\n     data-ad-slot=\"1820454727\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n<\/td>\n\n<td>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6354467409705666\"\n     crossorigin=\"anonymous\"><\/script>\n<!-- py-article-doubleB -->\n<ins class=\"adsbygoogle\"\n     style=\"display:inline-block;width:336px;height:300px\"\n     data-ad-client=\"ca-pub-6354467409705666\"\n     data-ad-slot=\"3395043238\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">How to convert variable types<\/h2>\n\n\n\n<p>Data types can be converted.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Below are the main type conversion functions.<\/p>\n\n\n\n<p class=\"is-style-st-paragraph-memo\">int() : Conversion to integer type.<br>float() : Conversion to float type.<br>str() : Conversion to string type.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code line-numbers language-Python\"><code>num = \"1\"\nprint(type(num))\n\n###Output###\n#&lt;class 'str'&gt;\n\nnum = int(num)\nprint(type(num))\n\n###Output###\n#&lt;class 'int'&gt;<\/code><\/pre>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p style=\"color:#666;margin-bottom:5px;\">sponsored link<\/p>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6354467409705666\"\n     crossorigin=\"anonymous\"><\/script>\n<!-- py-article-display -->\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-6354467409705666\"\n     data-ad-slot=\"6239864271\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\">\u3010Appendix\u3011Naming Conventions other than variable<\/h2>\n\n\n\n<p>As a supplement, I also show naming conventions other than variable.<\/p>\n\n\n\n<table id=\"tablepress-4\" class=\"tablepress tablepress-id-4\">\n<thead>\n<tr class=\"row-1 odd\">\n\t<th class=\"column-1\">Item<\/th><th class=\"column-2\">Rule<\/th><th class=\"column-3\">Example<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-hover\">\n<tr class=\"row-2 even\">\n\t<td class=\"column-1\">Package<\/td><td class=\"column-2\">\u30fbAll lowercase<br \/>\n\u30fbUnderscore is deprecated<\/td><td class=\"column-3\">tqdm, requests<\/td>\n<\/tr>\n<tr class=\"row-3 odd\">\n\t<td class=\"column-1\">Module<\/td><td class=\"column-2\">\u30fbAll lowercase<br \/>\n\u30fbUnderscore is available<\/td><td class=\"column-3\">sys, os<\/td>\n<\/tr>\n<tr class=\"row-4 even\">\n\t<td class=\"column-1\">Class<\/td><td class=\"column-2\">\u30fbFirst letter is  uppercase<br \/>\n\u30fbDelimiter : uppercase<\/td><td class=\"column-3\">MyFavoriteClass<\/td>\n<\/tr>\n<tr class=\"row-5 odd\">\n\t<td class=\"column-1\">Exception<\/td><td class=\"column-2\">\u30fbFirst letter is uppercase<br \/>\n\u30fbDelimiter : uppercase<\/td><td class=\"column-3\">MyError<\/td>\n<\/tr>\n<tr class=\"row-6 even\">\n\t<td class=\"column-1\">Method<\/td><td class=\"column-2\">\u30fbAll lowercase<br \/>\n\u30fbDelimiter : underscore<\/td><td class=\"column-3\">my_favorite_method<\/td>\n<\/tr>\n<tr class=\"row-7 odd\">\n\t<td class=\"column-1\">Function<\/td><td class=\"column-2\">\u30fbAll lowercase<br \/>\n\u30fbDelimiter : underscore<\/td><td class=\"column-3\">my_favorite_funcion<\/td>\n<\/tr>\n<tr class=\"row-8 even\">\n\t<td class=\"column-1\">Variable<\/td><td class=\"column-2\">\u30fbAll lowercase<br \/>\n\u30fbDelimiter : underscore<\/td><td class=\"column-3\">my_favorite_instance<\/td>\n<\/tr>\n<tr class=\"row-9 odd\">\n\t<td class=\"column-1\">Constant<\/td><td class=\"column-2\">\u30fbAll uppercase<br \/>\n\u30fbDelimiter : underscore<\/td><td class=\"column-3\">MY_FAVORITE_CONST<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-4 from cache -->\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p style=\"color:#666;margin-bottom:5px;\">sponsored link<\/p>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6354467409705666\"\n     crossorigin=\"anonymous\"><\/script>\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-matched-content-rows-num=\"4,2\"\n     data-matched-content-columns-num=\"1,4\"\n     data-matched-content-ui-type=\"image_stacked,image_stacked\"\n     data-ad-format=\"autorelaxed\"\n     data-ad-client=\"ca-pub-6354467409705666\"\n     data-ad-slot=\"2243394422\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>This article shows basics of variables in Python. Proper understanding of variable naming convention &#8230; <\/p>\n","protected":false},"author":1,"featured_media":1785,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[16],"_links":{"self":[{"href":"https:\/\/python-academia.com\/en\/wp-json\/wp\/v2\/posts\/1454"}],"collection":[{"href":"https:\/\/python-academia.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-academia.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-academia.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/python-academia.com\/en\/wp-json\/wp\/v2\/comments?post=1454"}],"version-history":[{"count":119,"href":"https:\/\/python-academia.com\/en\/wp-json\/wp\/v2\/posts\/1454\/revisions"}],"predecessor-version":[{"id":1784,"href":"https:\/\/python-academia.com\/en\/wp-json\/wp\/v2\/posts\/1454\/revisions\/1784"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-academia.com\/en\/wp-json\/wp\/v2\/media\/1785"}],"wp:attachment":[{"href":"https:\/\/python-academia.com\/en\/wp-json\/wp\/v2\/media?parent=1454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-academia.com\/en\/wp-json\/wp\/v2\/categories?post=1454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-academia.com\/en\/wp-json\/wp\/v2\/tags?post=1454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}