Smart Baba special limited offer. We are the only world lowest-cost,
yet professional and elegant-designing website developing company.
Follow us for further details:
www.websitedeals.com
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 22, 8:07 am, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
On Thu, 21 Oct 2010 03:51:07 -0700 (PDT), Baba raoul...@gmail.com
declaimed the following in gmane.comp.python.general:
Hi everyone
i need a hint regarding the following exercise question:
Write a program that generates
On Oct 22, 6:35 am, Terry Reedy tjre...@udel.edu wrote:
On 10/21/2010 7:55 PM, Baba wrote:
the bit i'm having difficulties with in constructing my loops is:
whose small sides are no larger than n
from math import sqrt
def py_trips(n):
for b in range(4,n+1):
for a in range(3,b+1
On Oct 22, 6:35 am, Terry Reedy tjre...@udel.edu wrote:
On 10/21/2010 7:55 PM, Baba wrote:
the bit i'm having difficulties with in constructing my loops is:
whose small sides are no larger than n
from math import sqrt
def py_trips(n):
for b in range(4,n+1):
for a in range(3,b+1
out where to fit in n.
a^a + b^b = c^c is the condition to satisfy and i need to use loops
and n will be an upper limit of one (or more?) of the loops but i am
a bit lost. Please help me get thinking about this right.
exercise source: Java by Dissection (Ira Pohl and Charlie McDowell)
thanks
Baba
( a * a + b * b)
if c % 1 == 0:
print (a, b, int(c))
this returns
(3, 4, 5) (6, 8, 10) (5, 12, 13) (9, 12, 15) (8, 15, 17) (12, 16, 20)
is that the desired output? what is the step that i'm missing?
thanks in advance
Baba
p.s. this is not homework but self-study
--
http
On Oct 21, 10:18 pm, Terry Reedy tjre...@udel.edu wrote:
On 10/21/2010 6:55 AM, Baba wrote:
Hi everyone
i need a hint regarding the following exercise question:
Write a program that generates all Pythagorean triples whose small
sides are no larger than n.
This is not well worded. I
On Sep 23, 4:17 pm, nn prueba...@latinmail.com wrote:
On Sep 23, 10:56 am, nn prueba...@latinmail.com wrote:
On Sep 22, 6:39 pm, Baba raoul...@gmail.com wrote:
On Sep 22, 9:18 pm, Baba raoul...@gmail.com wrote:
On Sep 22, 3:38 pm, nn prueba...@latinmail.com wrote:
On Sep 21, 6
On Sep 23, 8:13 pm, nn prueba...@latinmail.com wrote:
On Sep 23, 1:25 pm, Baba raoul...@gmail.com wrote:
On Sep 23, 4:17 pm, nn prueba...@latinmail.com wrote:
On Sep 23, 10:56 am, nn prueba...@latinmail.com wrote:
On Sep 22, 6:39 pm, Baba raoul...@gmail.com wrote:
On Sep 22, 9
On Sep 23, 8:13 pm, nn prueba...@latinmail.com wrote:
On Sep 23, 1:25 pm, Baba raoul...@gmail.com wrote:
On Sep 23, 4:17 pm, nn prueba...@latinmail.com wrote:
On Sep 23, 10:56 am, nn prueba...@latinmail.com wrote:
On Sep 22, 6:39 pm, Baba raoul...@gmail.com wrote:
On Sep 22, 9
On Sep 22, 3:38 pm, nn prueba...@latinmail.com wrote:
On Sep 21, 6:39 pm, Baba raoul...@gmail.com wrote:
Hi
query level: beginner
as part of a learning exercise i have written code that:
a) asks for a single letter input (assumption: only 1 letter wil be
entered)
b) adds
On Sep 22, 9:18 pm, Baba raoul...@gmail.com wrote:
On Sep 22, 3:38 pm, nn prueba...@latinmail.com wrote:
On Sep 21, 6:39 pm, Baba raoul...@gmail.com wrote:
Hi
query level: beginner
as part of a learning exercise i have written code that:
a) asks for a single letter input
source:
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/assignments/pset5.pdf
thanks
Baba
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 21, 1:39 pm, Mel mwil...@the-wire.com wrote:
Baba wrote:
I am working on a simple wordgame exercise: 2 players form a word by
alternating turns saying a letter, which is added on to the end of the
word fragment.
I am familiar with loops, iterations etc but i need a hint as to how
nesting of IF, WHILE and FOR statements is overkill?
inspired by part IV of
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/assignments/pset5.pdf
thanks
Baba
--
http://mail.python.org/mailman/listinfo/python
On Sep 9, 10:09 pm, Nobody nob...@nowhere.com wrote:
On Wed, 08 Sep 2010 03:30:00 -0700, Baba wrote:
Who is licensed to judge what can and cannot be posted as a question?
Exactly the same set of people who are licensed to judge what can and
cannot be posted as an answer.
If you don't like
On Sep 9, 11:22 pm, Alain Ketterlin al...@dpt-info.u-strasbg.fr
wrote:
Baba raoul...@gmail.com writes:
In below code the outer loop test in step 4 will execute ( n + 1 )
times (note that an extra step is required to terminate the for loop,
hence n + 1 and not n executions), which
integer from input
2if n 10
3print This might take a while...
4for i = 1 to n
5for j = 1 to i
6print i * j
7print Done!
Why does step 4 execute n+1 times? what is the exta step mentioned
above
tnx
Baba
--
http://mail.python.org/mailman/listinfo/python-list
!
Baba
--
http://mail.python.org/mailman/listinfo/python-list
On 8 sep, 02:07, Ben Finney ben+pyt...@benfinney.id.au wrote:
Baba raoul...@gmail.com writes:
However the following Wiki excerpt seems to go in my direction:
No, it doesn't. It advises that people show kindness; as I've been
arguing, that's exactly what you were shown. You haven't shown how
On 8 sep, 12:46, Paul Rubin no.em...@nospam.invalid wrote:
Baba raoul...@gmail.com writes:
It is just unfriendly
to tell someone to go and look it up by themselves.
Someone seeing too many unthoughtful questions from you might tell you
to look it up yourself, in the hopes of getting you
On 8 sep, 14:39, Paul Rubin no.em...@nospam.invalid wrote:
Baba raoul...@gmail.com writes:
But where do you draw the line? Can we not just let people ask
questions regardless? And let those answer who want to and those who
don't just ignore the question? That seems so much easier to me
On 7 sep, 02:18, Ben Finney ben+pyt...@benfinney.id.au wrote:
Ben Finney ben+pyt...@benfinney.id.au writes:
We value respect for people here, and that's what you've been shown
consistently. But respect for opinions, or for delicacy about
learning, is not welcome here.
Sloppy wording, I
On 7 sep, 13:39, Baba raoul...@gmail.com wrote:
On 7 sep, 02:18, Ben Finney ben+pyt...@benfinney.id.au wrote:
Ben Finney ben+pyt...@benfinney.id.au writes:
We value respect for people here, and that's what you've been shown
consistently. But respect for opinions, or for delicacy
is unordered. How Can i however avoid
'acidental' mutation?
Thanks
Baba
--
http://mail.python.org/mailman/listinfo/python-list
On 7 sep, 16:50, Grant Edwards inva...@invalid.invalid wrote:
On 2010-09-07, Baba raoul...@gmail.com wrote:
Sloppy wording, I apologise. This should say: If you find the
question you're reading too easy then just don't answer. Noone is the
owner of a democratic forum where freedom to ask
any good
hints so i'm trying here.
Thanks Baba
--
http://mail.python.org/mailman/listinfo/python-list
On 7 sep, 22:08, Gary Herron gher...@digipen.edu wrote:
On 09/07/2010 12:46 PM, Baba wrote:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
Just go through each letter of word checking for its existence in
dict2. Return False if one misses, and True if you get through
up of elements of dict2.
Your hint pointed me in the right direction.
for k in word.keys():
if k not in hand:
return False
elif k in hand:
if word[k] hand[k]:
return False
return True
Baba
--
http
On 6 sep, 00:01, Benjamin Kaplan benjamin.kap...@case.edu wrote:
On Sun, Sep 5, 2010 at 5:47 PM, Baba raoul...@gmail.com wrote:
level: beginner
how can i access the contents of a text file in Python?
i would like to compare a string (word) with the content of a text
file (word_list). i
On 6 sep, 00:04, Seth Rees s...@sthrs.me wrote:
On 09/05/10 16:47, Baba wrote:
level: beginner
how can i access the contents of a text file in Python?
i would like to compare a string (word) with the content of a text
file (word_list). i want to see if word is in word_list. let's
On 6 sep, 16:58, Thomas Jollans tho...@jollybox.de wrote:
On Monday 06 September 2010, it occurred to Baba to exclaim:
On 6 sep, 00:01, Benjamin Kaplan benjamin.kap...@case.edu wrote:
On Sun, Sep 5, 2010 at 5:47 PM, Baba raoul...@gmail.com wrote:
level: beginner
how can i access
On 6 sep, 18:14, geremy condra debat...@gmail.com wrote:
On Mon, Sep 6, 2010 at 8:53 AM, Baba raoul...@gmail.com wrote:
On 6 sep, 16:58, Thomas Jollans tho...@jollybox.de wrote:
On Monday 06 September 2010, it occurred to Baba to exclaim:
On 6 sep, 00:01, Benjamin Kaplan benjamin.kap
, word_list)
thanks
Baba
--
http://mail.python.org/mailman/listinfo/python-list
at the output you will see that the interval DOES seem to
reduce at each interval as expenses and fundsize reduce gradually. The
computation does not lead to an infinite loop.
tnx
Baba
--
http://mail.python.org/mailman/listinfo/python-list
return fundsize
findMaxExpenses(1,10,[3, 4, 5, 0, 3],[10, 5, 0, 5, 1],0.01)
thanks
Baba
--
http://mail.python.org/mailman/listinfo/python-list
to considerably optimise my approach:
def fib_range(start, end):
fib_1 = 0
fib_2 = 1
range = []
while fib_2 end:
fib_1, fib_2 = fib_2, fib_1 + fib_2
if fib_2 = start and fib_2 = end:
range.append(fib_2)
return range
print fib_range(4,76)
Thanks
Baba
?
def r_fib(n):
if n == 1: return 1
elif n == 2: return 2
else: return r_fib(n-2) + r_fib(n-1)
print r_fib(12)
Thanks
Baba
--
http://mail.python.org/mailman/listinfo/python-list
)
thanks
Baba
--
http://mail.python.org/mailman/listinfo/python-list
Thanks to All for your kind help!
Baba
--
http://mail.python.org/mailman/listinfo/python-list
fibonacci(n):
# base case:
fibonacci(n+2) - fibonacci(n+1) - n = 0
this too would create overlapping recursions
How to go about this?
Thanks
Baba
--
http://mail.python.org/mailman/listinfo/python-list
compared chars were identical hence it
is a palindrome and i return True
tnx
Baba
--
http://mail.python.org/mailman/listinfo/python-list
if the ELSE clause is positioned
under the second FOR loop. As if it was an ELSE clause without an IF
statement!?
Why/How does this work?
tnx
Baba
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 22, 7:12 pm, Tim Chase python.l...@tim.thechases.com wrote:
On 08/22/10 12:50, Baba wrote:
level: beginners
I was trying to write simple code that compares 2 tuples and returns
any element in the second tuple that is not in the first tuple.
def tuples(t1, t2):
result
above?
tnx
Baba
--
http://mail.python.org/mailman/listinfo/python-list
len(key)==len(target):
if key==target:
counter+=1
return counter
else:
return counter
return counter
print r_countSubStringMatch(atgacatgcacaagtatgcat,atgc)
tnx
Baba
--
http://mail.python.org/mailman/listinfo/python-list
else:
return counter
elif len(key)==len(target):
if key==target:
counter+=1
return counter
else:
return counter
return counter
print r_countSubStringMatch(atgacatgcacaagtatgcat,atgc)
tnx
Baba
--
http://mail.python.org/mailman/listinfo
:
print 'key is longer than target...'
print '%s is %d times in the target string' %(key,counter)
countSubStringMatchRecursive(atgacatgcacaagtatgcat,atgacatgcacaagtatgcatatgc)
tnx
Baba
--
http://mail.python.org/mailman/listinfo/python-list
to speed.
kind regards to everyone!
Baba
--
http://mail.python.org/mailman/listinfo/python-list
to problem 3: explain in English
why the theorem is true
@Giacomo: when you say that i have not read the text of the assignment
i tend to disagree. Therefore could you point out what it is i
overlooked that should help me prove my assumption for the
generalisation? Enjoy the sausages btw :)
tnx
Baba
Hi Chas, Roald,
These are all complicated formula that i believe are not expected at
this level. If you look at the source (see my first submission) you
will see that this exercise is only the second in a series called
Introduction to Programming. Therefore i am convinced that there is
a much
):
#print trying for %d: %d %d %d % (n_nuggets,a,b,c)
if packages[0]*a+packages[1]*b+packages[2]*c==n_nuggets:
can_buy=True
break
if can_buy==True:
cbc+=1
else:
cbc=0
sol=n_nuggets
print sol
Baba
--
http://mail.python.org
Hi John,
Thanks for your submission! I've improved a lot and everone's help so
far has been thrilling amd is very good for my self-study
motivation :)
ok so i think i'm clear on how to approach this problem and on how to
write basic but clean Python code to solve it.
The next step is to
Hi John,
Thanks for your submission! I've improved a lot and everone's help so
far has been thrilling and is very good for my self-study
motivation :)
ok so i think i'm clear on how to approach this problem and on how to
write basic but clean Python code to solve it.
The next step is to
Hi All,
@Emile tnx for spotting the mistake. Should have seen it myself.
@John Ian i had a look around but couldn't find a general version of
below theorem
If it is possible to buy x, x+1,…, x+5 sets of McNuggets, for some x,
then it is possible to buy any number of McNuggets = x, given that
Hi Mel,
indeed i thought of generalising the theorem as follows:
If it is possible to buy n, n+1,…, n+(x-1) sets of McNuggets, for some
x, then it is possible to buy any number of McNuggets = x, given that
McNuggets come in x, y and z packs.
so with diophantine_nuggets(7,10,21) i would need 7
suppose this can be tweaked to make it shorter? For instance i
wonder if i can do the same with less variable to be defined?
tnx
Baba
--
http://mail.python.org/mailman/listinfo/python-list
):
result = can_buy(n_nuggets)
if result==True:
truelist=truelist+[n_nuggets,]
else:
falselist=falselist+[n_nuggets,]
print 'true',truelist
print 'false',falselist
tnx
Baba
--
http://mail.python.org/mailman/listinfo/python-list
):
result = can_buy(n_nuggets)
if result==True:
truelist=truelist+[n_nuggets,]
else:
falselist=falselist+[n_nuggets,]
print 'true',truelist
print 'false',falselist
tnx
Baba
--
http://mail.python.org/mailman/listinfo/python-list
a
value nothing happens. What is wrong? My syntax? My semantic? Both?
tnx
Baba
--
http://mail.python.org/mailman/listinfo/python-list
level: beginner
exercise: given that packs of McNuggets can only be bought in 6, 9 or
20 packs, write an exhaustive search to find the largest number of
McNuggets that cannot be bought in exact quantity.
exercise source:
Hi, this is my question:
I want to know if several switch (about 50) in a big lan are up and then
know their MAC addresses to do a list that contains host name, ip and mac.
I know only the range of their IP addresses (the host name it's simply
to know using socket.gethostn.
The first idea it's
62 matches
Mail list logo