{"id":38692,"date":"2016-10-28T17:11:49","date_gmt":"2016-10-28T22:11:49","guid":{"rendered":"http:\/\/sernap97.wordpress.com\/?p=114"},"modified":"2016-10-28T17:11:49","modified_gmt":"2016-10-28T22:11:49","slug":"nesting-conditional-statements-2","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/nesting-conditional-statements-2\/","title":{"rendered":"Nesting Conditional Statements"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/sernap97.wordpress.com\/2016\/10\/28\/nesting-conditional-statements\/\"><a href=\"https:\/\/sernap97.wordpress.com\">Python<\/a><\/a><\/em><br \/><\/p>\n<p>Nesting conditional statements refers to the process of writing a conditional statement inside of another. For example, if we were to use &#8220;if&#8221; we could write another &#8220;if&#8221; inside of it but with a more specific condition.\u00a0It&#8217;s like having several filters in order to see which condition is true. And depending on that condition, a specific process will be done. Here&#8217;s an example:<\/p>\n<p>Code:<\/p>\n<p>num = int(input(&#8220;Type a number: &#8220;))<\/p>\n<p>if num&lt;=0:<br \/>\nif num&lt;=-10:<br \/>\nif num&lt;-100:<br \/>\nprint(&#8220;Your number is smaller than -100&#8221;)<br \/>\nelse:<br \/>\nprint(&#8220;Your number is between -10 and -100&#8221;)<br \/>\nelse:<br \/>\nprint(&#8220;Your number is between 0 and -10&#8221;)<br \/>\nelse:<br \/>\nprint(&#8220;Your number is bigger than 0&#8221;)<\/p>\n<p><img class=\"alignnone size-full wp-image-189\" src=\"https:\/\/sernap97.files.wordpress.com\/2016\/10\/2nesting.png?w=676\" alt=\"2nesting\" srcset=\"https:\/\/sernap97.files.wordpress.com\/2016\/10\/2nesting.png?w=676 676w, https:\/\/sernap97.files.wordpress.com\/2016\/10\/2nesting.png?w=150 150w, https:\/\/sernap97.files.wordpress.com\/2016\/10\/2nesting.png?w=300 300w, https:\/\/sernap97.files.wordpress.com\/2016\/10\/2nesting.png 732w\" sizes=\"(max-width: 676px) 100vw, 676px\"   \/><\/p>\n<p>&nbsp;<\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/sernap97.wordpress.com\/114\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/sernap97.wordpress.com\/114\/\" \/><\/a> <img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=sernap97.wordpress.com&#038;blog=115348265&%23038;post=114&%23038;subd=sernap97&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at Python Nesting conditional statements refers to the process of writing a conditional statement inside of another. For example, if we were to use &#8220;if&#8221; we could write another &#8220;if&#8221; inside of it but with a more specific condition.\u00a0It&#8217;s like having several filters in order to see which condition is true. And depending &hellip; <a href=\"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/nesting-conditional-statements-2\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Nesting Conditional Statements<\/span><\/a><\/p>\n","protected":false},"author":33,"featured_media":189,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[89,349,350,351],"class_list":["post-38692","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-python3","tag-conditional-statements","tag-ifs","tag-nesting"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/comments?post=38692"}],"version-history":[{"count":7,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38692\/revisions"}],"predecessor-version":[{"id":42718,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38692\/revisions\/42718"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media?parent=38692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/categories?post=38692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/tags?post=38692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}