The wsq10 asks me to do a program that recieves only two data from the user: a lower bound and an upper bound.<\/p>\n
With thopse two parameters I had to tell the user how many palindromes, see for palindromes<\/a><\/span>, are in that range; how many palindromes are in that range after do the\u00a0Lychrel number test and how many Lycher there exists, see for Lychrel<\/a><\/span>.<\/p>\n The first thing I did was seting the condition needed to get a natural palindrome, like 55 or 101, then to set a condition to exclude base 10 numbers, like 130 o 18290;<\/p>\n <\/a><\/p>\n That means, if x and y are the same (if is a palindrome \ud83d\ude42\u00a0) we’ve got a palindrome; <\/em>if the last digit is cero, then is a base 10 number and i counted it as a plaindrome.<\/p>\n Then, the hard parts makes its entrance<\/p>\n <\/a><\/p>\n Well, that means that if it is not a natural palindrome, and is not a base ten number, then we will try to convert it to palindrome by adding the number with its inverse, in the code is the part x = x + y, where y = x[::-1].<\/p>\n EXTRA: the code x[::-1] means that it will ignore the start and the end and it just going to move the last digit. The wrong way to do it it’s putting cero<\/p>\n So that loop will check it 30 times, if it does not meet the condition x == y, then it will be a Lychrel number, else it will be a forced palindrome.<\/p>\n It was really a challange to me and I really liked it; i’d like to do more of those challenging programs<\/p>\n Github code<\/a><\/span><\/p>\n <\/p>\n <\/a> <\/p>\n","protected":false},"excerpt":{"rendered":" The wsq10 asks me to do a program that recieves only two data from the user: a lower bound and an upper bound. With thopse two parameters I had to tell the user how many palindromes, see for palindromes, are in that range; how many … Continúa leyendo WSQ11: A pain in the … feelings<\/span><\/a><\/p>\n","protected":false},"author":191,"featured_media":24124,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[45,344],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/24128"}],"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\/191"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/comments?post=24128"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/24128\/revisions"}],"predecessor-version":[{"id":24129,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/24128\/revisions\/24129"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media\/24124"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media?parent=24128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/categories?post=24128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/tags?post=24128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}