{"id":38999,"date":"2016-11-19T20:59:07","date_gmt":"2016-11-20T02:59:07","guid":{"rendered":"http:\/\/hectormtzblog.wordpress.com\/?p=920"},"modified":"2016-11-19T20:59:07","modified_gmt":"2016-11-20T02:59:07","slug":"validation","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/validation\/","title":{"rendered":"Validation"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/hectormtzblog.wordpress.com\/2016\/11\/19\/validation\/\"><a href=\"https:\/\/hectormtzblog.wordpress.com\">Hector Martinez Alcantara<\/a><\/a><\/em><br \/><\/p>\n<p>A validation is when you request an specific type of value from the user, so, you have to force the user to type what you want.<\/p>\n<p>Let&#8217;s do an example:<\/p>\n<pre>var=input(\"Type a number\\n\")\nwhile str.isnumeric(var)== 0:\n var=input(\"That's not a number, please type a number\\n\")\nprint(\"%s is the number you typed\"%(var))<\/pre>\n<p>First, you require a string from the user, if the string is not a number, the program will request the number again.<\/p>\n<p>That&#8217;s the main idea of a validation, depends on you how many conditions you want in your validation.<\/p>\n<p><img src=\"https:\/\/cdn.meme.am\/instances\/500x\/64360067.jpg\" \/><\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/hectormtzblog.wordpress.com\/920\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/hectormtzblog.wordpress.com\/920\/\" \/><\/a> <img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=hectormtzblog.wordpress.com&#038;blog=115238241&%23038;post=920&%23038;subd=hectormtzblog&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at Hector Martinez Alcantara A validation is when you request an specific type of value from the user, so, you have to force the user to type what you want. Let&#8217;s do an example: var=input(&#8220;Type a number\\n&#8221;) while str.isnumeric(var)== 0: var=input(&#8220;That&#8217;s not a number, please type a number\\n&#8221;) print(&#8220;%s is the number you &hellip; <a href=\"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/validation\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Validation<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":39000,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[88,89,44,26,33],"class_list":["post-38999","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-learninganewlanguage","tag-python3","tag-loops","tag-sin-categoria","tag-tc101"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38999","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\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/comments?post=38999"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38999\/revisions"}],"predecessor-version":[{"id":39001,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38999\/revisions\/39001"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media\/39000"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media?parent=38999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/categories?post=38999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/tags?post=38999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}