On 2017-04-04 12:12, Alan Gauld via Tutor wrote:
On 04/04/17 17:55, Lisa Hasler Waters wrote:
A middle school student of mine created a program to calculate simple
and
compound interest. He built it in PyCharm EDU using a Mac running
10.11.6.
He would like to create a GUI to run this program
On Fri, Apr 14, 2017 at 11:59:25PM +0530, shubham goyal wrote:
> sorted(ls)
> sorted(ls1)
Here you sort ls and throw the result away, then you do the same to ls1.
sorted() makes a copy of the list and sorts it. You need to write:
ls = sorted(ls)
ls1 = sorted(ls1)
but even better would be t
Change your code to
def front_x(words):
# +++your code here+++
ls=[]
ls1=[]
for str in words:
if str[0]=='x':
ls.append(str)
else:
ls1.append(str);
print ls
print ls1
ls = sorted(ls)
ls1 = sorted(ls1)
ls.extend(ls1)
return ls
regards,
Sarma.
O
On 14/04/17 19:29, shubham goyal wrote:
> sorted function is not working when i am trying to sort the list of strings
> but list.sort() is working. can you please help me understand.
sort() sorts the list "in place". That is it sorts itself.
sorted() returns a sorted copy of the list. It does not
Dear mentors,
sorted function is not working when i am trying to sort the list of strings
but list.sort() is working. can you please help me understand.In this
question i was trying to sort the list but first sorting the letter
starting from x and taking them first.
def front_x(words):
# +++your
On 04/14/2017 01:11 PM, Alan Gauld via Tutor wrote:
On 14/04/17 13:41, Stephen P. Molnar wrote:
The equation that I a want to evaluate (the one that I programmed in
FORTRAN) is equation (7) in the attached scan of one of the pages of
Stephen P. Molnar and James W. King, Theory and Applications
Stephen P. Molnar wrote:
> The equation that I a want to evaluate (the one that I programmed in
> FORTRAN) is equation (7) in the attached scan of one of the pages of
Sorry Stephen, this is a text-only mailing list / news group. As far as I'm
concerned there is no attached scan.
Even if there
On 14/04/17 13:41, Stephen P. Molnar wrote:
> The equation that I a want to evaluate (the one that I programmed in
> FORTRAN) is equation (7) in the attached scan of one of the pages of
>
> Stephen P. Molnar and James W. King, Theory and Applications of the
> Integrated Molecular Transform and
On 04/14/2017 04:21 AM, Peter Otten wrote:
Stephen P. Molnar wrote:
However, what I want to do is multiply each element ob D by each element
of s and sum all of the products.
If you *really* want this:
sum_of_all_products = s.sum() * D.sum()
example:
s = [a b c]
D = [[a1 a2]
[a3 a4]
Stephen P. Molnar wrote:
> However, what I want to do is multiply each element ob D by each element
> of s and sum all of the products.
If you *really* want this:
sum_of_all_products = s.sum() * D.sum()
example:
s = [a b c]
D = [[a1 a2]
[a3 a4]]
a*a1 + a*a2 + a*a3 + a*a4 = a * D.sum()
Dear Alan Gauld,
Pure by coïncedent I found your answer to me on the internet at
http://code.activestate.com/lists/python-tutor/109848/
There was no answer on my e-mail account.
Your answer works !
Thanks for that !
Regards,
Wim Berrelkamp
Groningen, The Netherlands
On 12/04/17 13:47, Wim Berrel
> You need to open the file to create it:
Ok, got you. Thanks, Alan!
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
12 matches
Mail list logo