{"id":151492,"date":"2022-08-19T09:00:00","date_gmt":"2022-08-19T13:00:00","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=151492"},"modified":"2022-11-21T09:57:28","modified_gmt":"2022-11-21T14:57:28","slug":"basics-of-python-programming-part-ii","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basics-of-python-programming-part-ii\/","title":{"rendered":"Basics of Python Programming \u2013 Part II"},"content":{"rendered":"\n<p><em>See <a href=\"\/campus\/ibkr-quant-news\/basics-of-python-programming-part-i\/\">Part I<\/a> for an overview of the benefits and applications of Python in trading.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-syntax\">What is syntax?<\/h2>\n\n\n\n<p>Syntax implies the set of rules which define how the program will be written and interpreted.<\/p>\n\n\n\n<p>For example, this is the Python syntax:<\/p>\n\n\n\n<p><strong>print (\u201cWelcome, John!\u201d)<\/strong><\/p>\n\n\n\n<p>In the above example, syntax implies the characters such as opening and closing brackets&nbsp;<strong>()<\/strong>&nbsp;and the inverted commas&nbsp;<strong>\u201c\u201d<\/strong>&nbsp;as well as the keyword&nbsp;<strong>\u201cprint\u201d<\/strong>.<\/p>\n\n\n\n<p>Output:<\/p>\n\n\n\n<p>Welcome, John!<\/p>\n\n\n\n<p>Next, let us find out what indentation is.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-indentation\">What is indentation?<\/h2>\n\n\n\n<p>Python uses indentation to identify the different blocks of code. The white space indicates the indentation. All the codes with the same spaces on the left belong to the same block of code. Usually, the number of spaces on the left are four.<\/p>\n\n\n\n<p>Take a look at the example below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"791\" height=\"132\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2022\/08\/Python-Programming-quantinsti.png\" alt=\"\" class=\"wp-image-151781 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/08\/Python-Programming-quantinsti.png 791w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/08\/Python-Programming-quantinsti-700x117.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/08\/Python-Programming-quantinsti-300x50.png 300w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/08\/Python-Programming-quantinsti-768x128.png 768w\" data-sizes=\"(max-width: 791px) 100vw, 791px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 791px; aspect-ratio: 791\/132;\" \/><\/figure>\n\n\n\n<p>Output:<\/p>\n\n\n\n<p>64<\/p>\n\n\n\n<p>In the example above, since the second line of code is a separate expression, the indentation is not correct. Hence, when you run the code it throws an error. But when you remove the space\/indentation, the correct output is shown.<\/p>\n\n\n\n<p>Next, we will learn about the basic coding requirements which are variables and operators.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-are-variables-and-operators\">What are variables and operators?<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-variables\">Variables<\/h3>\n\n\n\n<p>Variables are characters or words that are given a user-defined value. Variables, as the name suggests can be varied during the execution of the code. They are allocated a space in the computer memory based on their data type. Python doesn&#8217;t require explicit declaration of the data type for a variable.<\/p>\n\n\n\n<p><strong>Example 1<\/strong><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n\n<p>45<\/p>\n\n\n\n<p>1456.8<\/p>\n\n\n\n<p>Alex<\/p>\n\n\n\n<p><strong>Example 2<\/strong><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n\n<p>100<\/p>\n\n\n\n<p><strong>Changing the value of a variable<\/strong><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n\n<p>Original value: &nbsp;100<\/p>\n\n\n\n<p>Updated value: 120.3<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-operators\">Operators<\/h3>\n\n\n\n<p>Operators are used on the values and variables in Python for performing certain operations.<\/p>\n\n\n\n<p>Take a look at different types of operators:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Arithmetic operators<\/li><li>Relational operators<\/li><li>Logical operators<\/li><li>Operator precedence<\/li><\/ul>\n\n\n\n<p><strong>Arithmetic operators<\/strong><\/p>\n\n\n\n<p>Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication, division, modulus, exponentiation and floor division.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n\n<p>Output:<\/p>\n\n\n\n<p>12<\/p>\n\n\n\n<p>4<\/p>\n\n\n\n<p>32<\/p>\n\n\n\n<p><strong>Relational operators<\/strong><\/p>\n\n\n\n<p>Relational operators compare the values of two expressions and return true or false.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n\n<p>Output:<\/p>\n\n\n\n<p>Is a greater than b?: False<\/p>\n\n\n\n<p>Is a smaller than b?: True<\/p>\n\n\n\n<p>Is a equal to b?: False<\/p>\n\n\n\n<p>Is a not equal to b?: True<\/p>\n\n\n\n<p>Is a greater than or equal to b?: False<\/p>\n\n\n\n<p>Is a smaller than or equal to b?: True<\/p>\n\n\n\n<p><strong>Logical operators<\/strong><\/p>\n\n\n\n<p>Logical operators perform Logical AND, Logical OR and Logical NOT operations.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n\n<p>If A, B and the combinations are as follows:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Case<\/td><td>A<\/td><td>B<\/td><td>A and B<br>print(A and B)<\/td><td>A or B<br>print(A or B)<\/td><td>Not A<br>print(Not A)<\/td><td>Not B<br>print(Not B)<\/td><\/tr><tr><td>1<\/td><td>True<\/td><td>False<\/td><td>False<\/td><td>True<\/td><td>False<\/td><td>True<\/td><\/tr><tr><td>2<\/td><td>True<\/td><td>True<\/td><td>True<\/td><td>True<\/td><td>False<\/td><td>False<\/td><\/tr><tr><td>3<\/td><td>False<\/td><td>True<\/td><td>False<\/td><td>True<\/td><td>True<\/td><td>False<\/td><\/tr><tr><td>4<\/td><td>False<\/td><td>False<\/td><td>False<\/td><td>False<\/td><td>True<\/td><td>True<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>In the table above, you can see how AND, OR and NOT are giving output.<\/p>\n\n\n\n<p><strong>Operator precedence<\/strong><\/p>\n\n\n\n<p>This is used in an expression with more than one operator to find out as to which operation to perform first.<\/p>\n\n\n\n<p>Take a look at the table below to find out all the operators of different precedence:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Operator in characters<\/td><td>Name of the operator<\/td><\/tr><tr><td>()<\/td><td>Parentheses<\/td><\/tr><tr><td>**<\/td><td>Exponent<\/td><\/tr><tr><td>* , \/, %<\/td><td>Multiplication, division, modulus<\/td><\/tr><tr><td>+-<\/td><td>Addition, subtraction<\/td><\/tr><tr><td>&lt;&lt;=&gt;&gt;=<\/td><td>Relational less than\/less than or equal toRelational greater than\/greater than or equal to<\/td><\/tr><tr><td>is, is notin, in not<\/td><td>IdentityMembership operators<\/td><\/tr><tr><td>not<\/td><td>Logical NOT<\/td><\/tr><tr><td>and<\/td><td>Logical AND<\/td><\/tr><tr><td>or<\/td><td>Logical OR<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>For example:<\/p>\n\n\n\n<p>Output:<\/p>\n\n\n\n<p>Hello! Welcome.<\/p>\n\n\n\n<p>Next comes the section explaining conditional statements and loops.<\/p>\n\n\n\n<p><em>Stay tuned for the next installment, in which Chainika Thakar&nbsp;will go over the conditional statements and loops.<\/em><\/p>\n\n\n\n<p><em>Visit QuantInsti Blog to learn more about this topic:&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/python-programming\/\">https:\/\/blog.quantinsti.com\/python-programming\/<\/a><\/em>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python uses indentation to identify the different blocks of code. The white space indicates the indentation.<\/p>\n","protected":false},"author":368,"featured_media":151496,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,349,338,350,341,344],"tags":[851,4873,6614,595,7391],"contributors-categories":[13654],"class_list":{"0":"post-151492","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-python-development","10":"category-ibkr-quant-news","11":"category-quant-asia-pacific","12":"category-quant-development","13":"category-quant-regions","14":"tag-algo-trading","15":"tag-backtesting","16":"tag-jupyter-notebook","17":"tag-python","18":"tag-quantitative-analysis","19":"contributors-categories-quantinsti"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Basics of Python Programming \u2013 Part II | IBKR Quant<\/title>\n<meta name=\"description\" content=\"Python uses indentation to identify the different blocks of code. The white space indicates the indentation.\" \/>\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.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/151492\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Basics of Python Programming \u2013 Part II | IBKR Quant Blog\" \/>\n<meta property=\"og:description\" content=\"Python uses indentation to identify the different blocks of code. The white space indicates the indentation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basics-of-python-programming-part-ii\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-19T13:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-21T14:57:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/08\/python-featured.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Chainika Thakar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Chainika Thakar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basics-of-python-programming-part-ii\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basics-of-python-programming-part-ii\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Chainika Thakar\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/c97b4c6a477fa019494f67cff50fcb10\"\n\t            },\n\t            \"headline\": \"Basics of Python Programming \u2013 Part II\",\n\t            \"datePublished\": \"2022-08-19T13:00:00+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:57:28+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basics-of-python-programming-part-ii\\\/\"\n\t            },\n\t            \"wordCount\": 612,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basics-of-python-programming-part-ii\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/08\\\/python-featured.jpg\",\n\t            \"keywords\": [\n\t                \"Algo Trading\",\n\t                \"backtesting\",\n\t                \"Jupyter Notebook\",\n\t                \"Python\",\n\t                \"Quantitative Analysis\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\",\n\t                \"Quant Asia Pacific\",\n\t                \"Quant Development\",\n\t                \"Quant Regions\"\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basics-of-python-programming-part-ii\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basics-of-python-programming-part-ii\\\/\",\n\t            \"name\": \"Basics of Python Programming \u2013 Part II | IBKR Quant Blog\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basics-of-python-programming-part-ii\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basics-of-python-programming-part-ii\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/08\\\/python-featured.jpg\",\n\t            \"datePublished\": \"2022-08-19T13:00:00+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:57:28+00:00\",\n\t            \"description\": \"Python uses indentation to identify the different blocks of code. The white space indicates the indentation.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basics-of-python-programming-part-ii\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basics-of-python-programming-part-ii\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/08\\\/python-featured.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/08\\\/python-featured.jpg\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"Python\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/c97b4c6a477fa019494f67cff50fcb10\",\n\t            \"name\": \"Chainika Thakar\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/chainikathakar\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Basics of Python Programming \u2013 Part II | IBKR Quant","description":"Python uses indentation to identify the different blocks of code. The white space indicates the indentation.","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.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/151492\/","og_locale":"en_US","og_type":"article","og_title":"Basics of Python Programming \u2013 Part II | IBKR Quant Blog","og_description":"Python uses indentation to identify the different blocks of code. The white space indicates the indentation.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basics-of-python-programming-part-ii\/","og_site_name":"IBKR Campus US","article_published_time":"2022-08-19T13:00:00+00:00","article_modified_time":"2022-11-21T14:57:28+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/08\/python-featured.jpg","type":"image\/jpeg"}],"author":"Chainika Thakar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Chainika Thakar","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basics-of-python-programming-part-ii\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basics-of-python-programming-part-ii\/"},"author":{"name":"Chainika Thakar","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/c97b4c6a477fa019494f67cff50fcb10"},"headline":"Basics of Python Programming \u2013 Part II","datePublished":"2022-08-19T13:00:00+00:00","dateModified":"2022-11-21T14:57:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basics-of-python-programming-part-ii\/"},"wordCount":612,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basics-of-python-programming-part-ii\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/08\/python-featured.jpg","keywords":["Algo Trading","backtesting","Jupyter Notebook","Python","Quantitative Analysis"],"articleSection":["Data Science","Programming Languages","Python Development","Quant","Quant Asia Pacific","Quant Development","Quant Regions"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basics-of-python-programming-part-ii\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basics-of-python-programming-part-ii\/","name":"Basics of Python Programming \u2013 Part II | IBKR Quant Blog","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basics-of-python-programming-part-ii\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basics-of-python-programming-part-ii\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/08\/python-featured.jpg","datePublished":"2022-08-19T13:00:00+00:00","dateModified":"2022-11-21T14:57:28+00:00","description":"Python uses indentation to identify the different blocks of code. The white space indicates the indentation.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basics-of-python-programming-part-ii\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basics-of-python-programming-part-ii\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/08\/python-featured.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/08\/python-featured.jpg","width":1000,"height":563,"caption":"Python"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/c97b4c6a477fa019494f67cff50fcb10","name":"Chainika Thakar","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/chainikathakar\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/08\/python-featured.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/151492","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/368"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=151492"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/151492\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/151496"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=151492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=151492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=151492"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=151492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}