Re: [Tutor] How do we create a GUI to run a simple calculation program in Python?

2017-04-14 Thread Alex Kleider
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

Re: [Tutor] sorted function

2017-04-14 Thread Steven D'Aprano
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

Re: [Tutor] sorted function

2017-04-14 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
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

Re: [Tutor] sorted function

2017-04-14 Thread Alan Gauld via Tutor
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

[Tutor] sorted function

2017-04-14 Thread shubham goyal
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

Re: [Tutor] Python 3.6 Multiply the elements of a 2D Array by the elements of a 1D Aeeay

2017-04-14 Thread Stephen P. Molnar
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

Re: [Tutor] Python 3.6 Multiply the elements of a 2D Array by the elements of a 1D Aeeay

2017-04-14 Thread Peter Otten
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

Re: [Tutor] Python 3.6 Multiply the elements of a 2D Array by the elements of a 1D Aeeay

2017-04-14 Thread Alan Gauld via Tutor
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

Re: [Tutor] Python 3.6 Multiply the elements of a 2D Array by the elements of a 1D Aeeay

2017-04-14 Thread Stephen P. Molnar
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]

Re: [Tutor] Python 3.6 Multiply the elements of a 2D Array by the elements of a 1D Aeeay

2017-04-14 Thread Peter Otten
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()

[Tutor] Fwd: Startup Python

2017-04-14 Thread Wim Berrelkamp
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

Re: [Tutor] creating .json files

2017-04-14 Thread Rafael Knuth
> 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