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":28163,"date":"2015-11-25T19:50:47","date_gmt":"2015-11-26T01:50:47","guid":{"rendered":"http:\/\/juansalvadorfernandez.wordpress.com\/?p=169"},"modified":"2015-11-25T19:50:47","modified_gmt":"2015-11-26T01:50:47","slug":"loops-with-while-5","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2015\/2015\/loops-with-while-5\/","title":{"rendered":"Loops with \u201cWhile\u201d"},"content":{"rendered":"

Looping will be very important skill for this course, from my experience more that 75% of the activities you will do during the course will require you to loop a piece of code.<\/p>\n

There are different ways to make loops, but right now we will review the one called \u201cWhile\u201d.<\/p>\n

The while loop basically takes a condition, and as long as this condition remains true the loop will continue, meaning that the instructions WITHIN the while will keep repeating themselves.<\/p>\n

For instance if we write: while(i>0): print(\u201chit yourself \u201d)<\/u>, the condition for the while to happen is i>0, so each time the loop repeats itself their two values will be compared to see if the condition is true or false.<\/p>\n

The piece written above has two ENOURMOUS mistakes, number one being that \u201ci\u201d has no assigned value, we can solve this by writing \u201ci=1\u201d before the while. The remaining problem is that, since there is nothing that makes the value of \u201ci\u201d change, it will always be one, meaning that it will always be bigger than zero and that the while will repeat itself endlessly, eating up your RAM and killing your computer, and that is a big no-no.<\/p>\n

One very simple way to solve this matter is to write \u201ci= i- 0.1\u201d inside the while, this way the value for i will change every time the while repeats itself, in this case turning into a smaller number, eventually reaching the value of zero.<\/p>\n

Now this is very important, once the condition the while has is no longer met, in this case i>0, the while will stop.<\/p>\n

For the program we wrote i=1, and each run of the while we subtract 0.1, turning it into 0.9, 0.8, 0.7 and so on till we reach zero, this means that the while will repeat itself ten times, performing the action inside it ten times.<\/p>\n

The outcome of our little program will be: \u201chit yourself hit yourself hit yourself hit yourself hit yourself hit yourself hit yourself hit yourself hit yourself hit yourself\u201d<\/p>\n

Of course this is just the basics, things will get scarier as we continue, but be patient and try to understand this as best as you can, since the while itself does not change, EVER, just the things outside it and inside it.<\/p>\n

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

Looping will be very important skill for this course, from my experience more that 75% of the activities you will do during the course will require you to loop a piece of code. There are different ways to make loops, but right now we will review the one called “While”. The while loop basically takes … Continue reading Loops with “While”<\/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":[906,802,39],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28163"}],"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=28163"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28163\/revisions"}],"predecessor-version":[{"id":28164,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28163\/revisions\/28164"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media?parent=28163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/categories?post=28163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/tags?post=28163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}