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":20184,"date":"2015-09-06T15:56:50","date_gmt":"2015-09-06T20:56:50","guid":{"rendered":"http:\/\/carminaperezguerrero.wordpress.com\/?p=30"},"modified":"2015-09-06T15:56:50","modified_gmt":"2015-09-06T20:56:50","slug":"wsq06-pick-a-number-5","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2015\/2015\/wsq06-pick-a-number-5\/","title":{"rendered":"WSQ06 \u2013 Pick a Number"},"content":{"rendered":"

This time the assignment was to write a program that picks a random integer in the range of 1 to 100. It then asks the user to guess the number, it continues to run\u00a0with hints of \u2019too high\u2019 or \u2019too low\u2019,\u00a0until they guess right. The program also\u00a0tells the user how many guesses they had made.<\/p>\n

\"PickNumatom\"<\/a> \"PickNumCygwin\"<\/a><\/p>\n

The new things in this assignment is the random function<\/strong>, handling exceptions<\/strong> and conditionals inside conditionals<\/strong>.<\/p>\n

A function is\u00a0a named section of a program that performs a specific task whenever it is called. Python has some included functions, to use them you first need to call them, for that we use import<\/strong> and the name of the library. Random has a lot of functions, they\u00a0are listed here<\/a>, but the one I used was ranrange<\/strong>, which chooses a random number included in a range I gave, in this case 1 to 100.<\/p>\n

We never know what the user will input, to counter that there are many methods. This time I needed an integer from the user, if the user were to write a string the program wouldn’t be able to run with that value, that is when we have to fight this exception. I used the method mentioned here<\/a>, you can check that out, there are a lot of ways to handle errors and exceptions<\/strong>.<\/p>\n

We saw\u00a0while loops and conditional statements\u00a0in WSQ05, but now we can see how we can have them one inside another. This may be a little difficult to grasp but it is quite useful when performing more complicated tasks.<\/p>\n

There was also a variable whose only purpose was to count the times a loop is repeated<\/strong>. At the end of the loop it always sums 1 to it self. This helps a lot when you want to keep track of the loops.<\/p>\n

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

This time the assignment was to write a program that picks a random integer in the range of 1 to 100. It then asks the user to guess the number, it continues to run with hints of ’too high’ or ’too low’, until they guess right. The program also tells the user how many guesses they had made. […]\"\"<\/p>\n","protected":false},"author":190,"featured_media":20182,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[167,39],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/20184"}],"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\/190"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/comments?post=20184"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/20184\/revisions"}],"predecessor-version":[{"id":20185,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/20184\/revisions\/20185"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media\/20182"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media?parent=20184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/categories?post=20184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/tags?post=20184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}