Hi!
Here one possible solution:
--- snip ---
land = [10,20,30,40,110,50,18,32,5]
landlength=len(land)
winnersplit=[]
for i in range(landlength-2):
for j in range(landlength-1-i):
splitsums=[sum(land[0:(i+1)]), sum(land[(i+1):(i+j+2)]),
sum(land[(i+j+2):landlength])]
differences
Hi!
Could it be, "Nuen9", that you would like to find a split where the
split sums are close to each other? In other words, you define the
number of splits (in your example: 3) and the algortihm should test all
possible combinations and select the split where the sum differences are
smallest.
Hi!
Is this a homework or something you need a quick solution for?
For the latter: 'man paste' (on Linux) :)
Anyway, some sample data and code would be good.
BR, Kimmo
03.03.2016, 11:50, m.t.e...@student.rug.nl wrote:
Hey!
I want to merge column-wise two csv files, say: file1.csv and file2.
Hi!
14.01.2016, 09:59, dieter wrote:
"SSL_VERIFICATION_FAILED" is an error which occurs when
an SSL ("https") connection is established. It happens when
the SSL certificate (of the server and/or client) does not contain
expected data - e.g. the certificate is no longer (or not yet) valid
or its
Dear list members!
I have written I small python script for twitter mining utilising the
'tweepy' library. Since a couple of days I cannot use the script
anymore, due to a "ssl certificate verification failed" error. The
authentication with Twitter API succeess, but when I try to run the
foll
Hi!
> leonardo writes:
how can i have it print a row of stars beside each number, like this?:
how many seconds?: 5
5 * * * * *
4 * * * *
3 * * *
2 * *
1 *
blast off!
--- snip ---
sec = int(input("How many seconds? "))
for i in range(0,sec):
print str(sec-i)+":"+" *"*(sec-i)
print
Hi!
Thanks, Michael, for your quick - and heplful - reply.
13.01.2013 18:46, Michael Torrie wrote:
You're wrong. curses does offer a direct solution to this. Check the
docs. Also here's a nice intro document for Python 3:
http://docs.python.org/dev/howto/curses.html
You are right :) The do
Hi!
I am working on a small console app for linux. The idea is to display
some sensor values and the screen should update itself in, say, every 10
seconds.
The user should have the possibly to change some configurations or gwt
help by pressing different keys (like you can do when running e.g
Hi!
Since there is no stated question, I need to guess:
n -= 1 (instead of "f -= 1")
should work.
Or maybe the question was a totally different one...
-Kimmo
11.01.2013 17:35, kwakukwat...@gmail.com wrote:
def factorial(n):
if n<2:
return 1
f = 1
while n>= 2: