Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":28169,"date":"2015-11-25T19:45:58","date_gmt":"2015-11-26T01:45:58","guid":{"rendered":"http:\/\/juansalvadorfernandez.wordpress.com\/?p=163"},"modified":"2015-11-25T19:45:58","modified_gmt":"2015-11-26T01:45:58","slug":"triple-kill-if-elif-and-else","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2015\/2015\/triple-kill-if-elif-and-else\/","title":{"rendered":"\u201cTriple kill\u201d: If, Elif and Else"},"content":{"rendered":"

#this is the only mastery with three topics since all of them relate to each other.#<\/p>\n

 <\/p>\n

This three pals work together to make our life easier and just like the while they work with conditions.<\/p>\n

We use if, elif and else when we desire to perform different actions depending on the outcome of a certain conditions, or multiple of them for that instance.<\/p>\n

First let\u2019s start with If and else. If will perform an action once IF a condition is met, and we use the else as a complement for this if, this is because if the condition of the \u201cif\u201d is not met, then the program will have nowhere else to go and it will die. Using \u201celse\u201d we suggest a second option, an escape route, for the program to use when the condition for \u201cif\u201d is not met.<\/p>\n

Now, the thing with while and if is that they give you only two options to choose from, vanilla or chocolate, that\u2019s why we have the \u201celif\u201d condition to help us out, with else we can add as many extra conditions as we desire, sparing us a lot of trouble.<\/p>\n

As an example:<\/p>\n

X=input (\u201cwrite 1 or 2\u201d)<\/p>\n

If (x=1):<\/p>\n

Print (\u201cyes\u201d)<\/p>\n

Elif (x=2):<\/p>\n

Print (\u201cno\u201d)<\/p>\n

Else:<\/p>\n

Print (\u201cwrong answer\u201d)<\/p>\n

 <\/p>\n

In here we are validating the answer given to us by the user, we give the program two specific conditions for pairing the value of x given to us by the user and an \u201cescape route\u201d in case that the value doesn\u2019t fit in any of the two previous conditions.<\/p>\n

First the program will get the value of x from the user, and it will pair it with each of the conditions, if the value provided by the user is equal to one then the program will print \u201cyes\u201d, and if I is not it will validate the second condition, in the case that the value is equal to two then the program will print \u201cno\u201d, last but not least, if the value given by the user is neither one or two, then the program will take the \u201cescape route\u201d and print \u201cwrong answer\u201d.<\/p>\n

This conditionals can be paired with \u201cWhile\u201d to make a program that constantly evaluates the values given to it, allowing us to make programs that adapt to a changing value.<\/p>\n

\"\"<\/a> \"\"<\/p>\n","protected":false},"excerpt":{"rendered":"

#this is the only mastery with three topics since all of them relate to each other.#   This three pals work together to make our life easier and just like the while they work with conditions. We use if, elif and else when we desire to perform different actions depending on the outcome of a … Continue reading “Triple kill”: If, Elif and Else<\/span><\/a>\"\"<\/p>\n","protected":false},"author":211,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[909,910,383,887,911,912,39],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28169"}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/users\/211"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/comments?post=28169"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28169\/revisions"}],"predecessor-version":[{"id":28170,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28169\/revisions\/28170"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media?parent=28169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/categories?post=28169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/tags?post=28169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}