eugenerator's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
New Members
Active Posts:
12 (0.02 per day)
Joined:
22-June 12
Profile Views:
266
Last Active:
User is offline Jun 28 2012 08:25 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Who Cares
Favorite Gaming Platform:
PC
Your Car:
Acura
Dream Kudos:
0
Icon   eugenerator has not set their status

Posts I've Made

  1. In Topic: Is there some sort of "wait" function built into python?

    Posted 27 Jun 2012

    Oh, okay, thanks. I found what I was looking for. Sorry for the trivial question. I just didn't know what to search for..

    Why do you "seldom like to do this"? Is using 'sleep' unconventional or sloppy in some way?
  2. In Topic: Good Logic Puzzle Books?

    Posted 25 Jun 2012

    Good suggestions guys! I'll definitely check out your suggestions.

    I also managed to find this, and it looks worth checking out.
  3. In Topic: What are your favorite music genres?

    Posted 23 Jun 2012

    I really like indie music!

    Some artists that I enjoy listening to are..
    Passion Pit
    MGMT
    Empire of the Sun
    The Naked and Famous

    My list is much longer, but I don't feel like typing it up :P
  4. In Topic: Error: "TypeError: 'NoneType' object is not subscriptable&

    Posted 22 Jun 2012

    Oh, I see. Yeah, that is a bit redundant on my part. I stand corrected! :D

    *le sigh*

    Why am I so bad? :(
  5. In Topic: Error: "TypeError: 'NoneType' object is not subscriptable&

    Posted 22 Jun 2012

    View Postsepp2k, on 22 June 2012 - 06:51 PM, said:

    range is exclusive, i.e. the sequence returned by range(n) will not include n. So range(1, len(numList)- 2) will not give you the index for the second to last element, so that is never checked.

    PS: Is there a reason why you compare the first and last character outside the loop, instead of just looping over all the characters?


    I actually adjusted the range(1, len(numList)- 2), but it still says that 990009 is a palindrome. Here is all of the code:
    def palindrome(number):
        palindrome = True
        numString = str(number)
        numList = list(numString)
        numRev = numList
        numList.reverse()
        
        if(numList[0] == numList[len(numList)-1]):
            for i in range(0, len(numList)- 1):
                if (numList[i] != numRev[i]):
                    palindrome = False
                    break
        else:
            palindrome = False
        return palindrome            
    
    num1 = 999
    num2 = 999
    
    largestPal = 0
    while(num1 > 100):
        while(num2 > 100):
            if(palindrome(num1*num2) == True):
                if((num1*num2) > largestPal):
                    largestPal = num1*num2
                    print(largestPal)
            num2 = num2-1
        num1 = num1-1
    
    


    And to answer your PS, the intention was to save time. Why check numbers whose first and last digits aren't the same?

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Location:
Missouri
Interests:
Reading, writing, learning (in general), tennis, running, The Real Housewives (don't judge me..), reddit (I'm not terribly active), foreign languages, etc, etc, etc..
Years Programming:
0
Programming Languages:
Python

Contact Information

E-mail:
Click here to e-mail me
Twitter:
https://twitter.com/#!/eugenerator4

Friends

eugenerator hasn't added any friends yet.

Comments

eugenerator has no profile comments yet. Why not say hello?