Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Diagonal grid products
Post: Diagonal grid products

#--Horizonal for i in range(len(pList)-3): prod = 1 for x in range(4): prod *= int(pList[i+x]) prods.append(prod) #--Vertical for i in range(114): prod = int(pList[i]) ...
PythonLamer Data Science 1 2,525 Dec-05-2017, 04:35 AM
    Thread: Sophie Germain Primes
Post: RE: Sophie Germain Primes

(Oct-28-2017, 03:08 AM)heiner55 Wrote: If I google for "prime number algorithm", I get a lot of suggestions. Maybe you should also google. It is enough to end the for-loop  if sqrt(n) instead of n/...
PythonLamer General Coding Help 7 5,644 Oct-28-2017, 04:44 AM
    Thread: Sophie Germain Primes
Post: RE: Sophie Germain Primes

(Oct-27-2017, 07:20 PM)heiner55 Wrote: Sorry, Your algorithm is still wrong, because     print(isPrime(5)) results in None instead of true. Maybe the last "return true" is wrong indented. Yep... it...
PythonLamer General Coding Help 7 5,644 Oct-27-2017, 09:01 PM
    Thread: Sophie Germain Primes
Post: RE: Sophie Germain Primes

(Oct-27-2017, 06:58 PM)heiner55 Wrote: Your algorithm is wrong, because     print(isPrime(5)) results in None instead of true. You're right... I actually just removed the lower digit checks altogeth...
PythonLamer General Coding Help 7 5,644 Oct-27-2017, 07:08 PM
    Thread: Sophie Germain Primes
Post: Sophie Germain Primes

Looking for a way to optimize this to have it run a bit faster: #!python3 def isPrime(num): if num < 2: return False if num == 2: return True else: for div in range(2,int(num / ...
PythonLamer General Coding Help 7 5,644 Oct-27-2017, 06:26 PM
    Thread: Requests not behaving...
Post: Requests not behaving...

Hey guys, I've been trying to establish an http connection with requests. The problem is that I'm getting an ssl exceptions error: requests.exceptions.SSLError: HTTPSConnectionPool(host='www.thesite...
PythonLamer General Coding Help 1 4,815 Oct-25-2017, 04:53 PM
    Thread: Word Search Solver
Post: RE: Word Search Solver

(Oct-09-2017, 09:42 PM)nilamo Wrote: Inside your login function, print out the response you get.  That's the first time you try printing anything to console, so logging in is probably failing. I sho...
PythonLamer General Coding Help 4 5,207 Oct-12-2017, 05:11 PM
    Thread: Word Search Solver
Post: Word Search Solver

Hello all, First time here. So I've pieced together some code and can't quite figure out how to get it to work. It's not throwing any errors, but it isn't printing any results either. Basically the c...
PythonLamer General Coding Help 4 5,207 Oct-07-2017, 05:26 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020