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":28161,"date":"2015-11-25T19:53:46","date_gmt":"2015-11-26T01:53:46","guid":{"rendered":"http:\/\/juansalvadorfernandez.wordpress.com\/?p=172"},"modified":"2015-11-25T19:53:46","modified_gmt":"2015-11-26T01:53:46","slug":"for-loops-with-for","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2015\/2015\/for-loops-with-for\/","title":{"rendered":"For loops with \u201cfor\u201d"},"content":{"rendered":"

We have already seen how to do loops with \u201cwhile\u201d, and now we will learn how to use the \u201cfor\u201d statement.<\/p>\n

The way you write a for is the following: \u201cfor i in x:\u201d, after that you fill up its guts with what action you want it to perform.<\/p>\n

The \u201cin\u201d part makes it so that the \u201cfor\u201d gets along especially well with ranges, list, tuples and dictionaries. What it does is that it makes your program search for a special something in the insides of another something, for example a range or a list, and then do something to that something it found, or simply perform an action according to it.<\/p>\n

We can convine this with other stuff, like ifs for example:<\/p>\n

L [1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 5]<\/p>\n

For I in L:<\/p>\n

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

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

Elif (I = 0):<\/p>\n

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

Else:<\/p>\n

Print (\u201cGet yourself together!\u201d)<\/p>\n

This program will check every value within the list \u201cL\u201d, and depending on its magnitude it will perform an action, printing \u201cyes\u201d if the value is one, \u201cno\u201d if the value is zero, or \u201cGet yourself together!\u201d if it finds another value.<\/p>\n

Using for statements gets fun when you start working with calculations or \u201csearches\u201d with big amounts of data, it will save your butt a lot of pain.<\/p>\n

The main difference between a \u201cwhile\u201d and a \u201cfor\u201d is that the while will run definitively if given the chance, but the \u201cfor\u201d fill always have a beginning and an end, since you work with finite things like lists and ranges. A \u201cfor\u201d CAN be infinite, but only if the range you are using is infinite itself.<\/p>\n

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

We have already seen how to do loops with “while”, and now we will learn how to use the “for” statement. The way you write a for is the following: “for i in x:”, after that you fill up its guts with what action you want it to perform. The “in” part makes it so … Continue reading For loops with “for”<\/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":[905,803,39],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28161"}],"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=28161"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28161\/revisions"}],"predecessor-version":[{"id":28162,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28161\/revisions\/28162"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media?parent=28161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/categories?post=28161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/tags?post=28161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}