-
Recent Posts
Recent Comments
Archives
Categories
Meta
Tag Archives: #WSQ11
Wsq 11
Helpfull Sources:
http://en.wikipedia.org/wiki/Palindrome
http://www.p196.org/
Github Link to my code:
https://github.com/FlorethGonzalez/Wsq-s/blob/12c2d8fed894856d0f1cecc491875094a6073905/wsq11.py
Comments Off on Wsq 11
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #TC1014, #WSQ11, Programming, Python
Wsq 11
Yo Soy 196
Helpfull Sources:
http://en.wikipedia.org/wiki/Palindrome
http://www.p196.org/
Github Link to my code:
https://github.com/FlorethGonzalez/Wsq-s/blob/12c2d8fed894856d0f1cecc491875094a6073905/wsq11.py
Comments Off on Wsq 11
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #TC1014, #WSQ11, Programming, Python
Yo soy 196 #WSQ11
Here’s my code for WSQ11, i think this was the most complicated WSQ this far, but I really liked doing it and going through the problem solving in my head. Of course, I used some help from Ken with the code:
https:/
Oscar Ricardo López López A01229116
Yo Soy 196
#WSQ11– Yo Soy 196 #TC1014 @PablO_CVi
create a program that asks the user for two pieces of data:
- The lower bound of the sequence
- The upper bound of the sequence
Then you check the values from the lower bound (inclusive) to the upper bound (inclusive) and make a report of them. During the analysis of each number, if a Lychrel number is found it should be reported immediately with something like “Found a Lychrel number: 196″
Comments Off on Yo Soy 196
Posted in Blogs, Syndicated, TC1014 Blogs
#WSQ11 #TC1017
Hi !! here is my #WSQ11 It should be the hardest program because i have no idea of how to use big integer and i have to ask some of my classmates how to implement this new library. Finally i got it and here is a link to my code in git hub 😀 !!!
WSQ11 – Yo soy 196
this program recives two number values, a low number and a higher number, and check the numbers from the lower to the highest number reporting: the range of numbers analyzed, number of natural palindromes, number of non-lychrel numbers, the amount of lychrel numbers found and print the lychrel numbers found.
to start i created a function to invert the integers so i could compare them.
def reverse(a):
a = str(a)
a = a[::-1]
a = int(a)
return a
this turns 123 into “123” into “321” into 321.
a function to determine if a number is a natural palindrome.
def palin(a):
a1 = a
a2 = reverse(a)
if a1 == a2:
return 1
else:
return 0
and a function to add the numbers to their inverse until they become a palindrome or reach a set amount of tries.
def nopalin(a)
c = 0
while c < 30:
a1 = a
a2 = reverse(a1)
a3 = a1+a2
a4 = reverse(a3)
if a3 == a4:
return 1
break
if a3 != a4:
a = a3
c += 1
if c >= 30:
return 0
that will take a number, invert it and add them until it becomes a palindrome for 30 tries, if it does not becomes a palindrome before then it will count as a lychrel number. after those 3 functions all you need is arrange them and add counters an a print order for the lychrel number found.
reference for the reverse function:
http:/
my code in github:
Comments Off on WSQ11 – Yo soy 196
Posted in Blogs, Syndicated, TC1014 Blogs
WSQ11
Hello people
Here´s the github link of my code for WSQ11. It´s been the most challenging WSQ so far because I didn´t know how to work with big integers, but it finally worked.
https:/
#TC1017 #wsq11: Lychrel Numbers
Finally I got this running!! It took me a lot of time to write this code, since I got lost a lot! It was a very challenging work, but I’m finished now! Here’s the link to Github, hope you find it useful for your code!
https:/
Comments Off on #TC1017 #wsq11: Lychrel Numbers
Posted in Blogs, Syndicated, TC1017 Blogs