Re: [Tutor] Python Interview Questions..

2011-05-27 Thread Alan Gauld
Marc Tompkins marc.tompk...@gmail.com wrote Java just isn't a hard enough language to separate great programmers from plodders (neither is Python, for that matter) because pointers and memory allocation are taken care of automagically. I fundamentally disagree with his stand on this. When

Re: [Tutor] Could I modify codes and validate immediately withoutrestart program?

2011-05-27 Thread Alan Gauld
char...@sohu.com wrote Hi, guys. Here is a demo program like this: aa = 3 bb = 4 cc = 53 dd = 6 print cc I put a breakpoint at the first line, then debug the program. After 'aa' is set to '3', I modify '53' in the 3rd line to '34', then save the source file and run remain codes. As expected,

Re: [Tutor] Python Interview Questions..

2011-05-27 Thread Alan Gauld
Alan Gauld alan.ga...@btinternet.com wrote of the term. The issue is about whether the programmer was trained in computing/engineering or whether it was someone who just knew a programming language. And I meant to add that this includes learning about the virtual machine - the execution

Re: [Tutor] Python Interview Questions..

2011-05-27 Thread lina
May I direct the interview question to another direction? are there some tests (I mean, just like the examination test) of python for beginner? which asked some basic but important questions (I do not want to learn python all of the stuff, it might be so huge for me.) and most important those

Re: [Tutor] Python Interview Questions..

2011-05-27 Thread Walter Prins
On 27 May 2011 09:59, Alan Gauld alan.ga...@btinternet.com wrote: Marc Tompkins marc.tompk...@gmail.com wrote Java just isn't a hard enough language to separate great programmers from plodders (neither is Python, for that matter) because pointers and memory allocation are taken care of

Re: [Tutor] Clunky Password maker

2011-05-27 Thread Steven D'Aprano
On Thu, 26 May 2011 05:45:30 am Alan Gauld wrote: [...] using the choice() function from the whrandom module. passwd = [whrandom.choice(series) for n in range(p)] whrandom was deleted in Python 2.5! I'm not sure when it was formally deprecated, but the recommended way of getting random

Re: [Tutor] Non programmer wanting to become programmer

2011-05-27 Thread amt
Thank you all for the replies. They helped me a lot. Have a great weekend! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Cherrypy

2011-05-27 Thread Steven D'Aprano
On Thu, 26 May 2011 12:16:05 am Bryton wrote: Is anyone having a step by step tutorial of cherrypy(or book title).I have used the tutorial in their site as well as the book (cherrypy essentials) and I would like to have a one that is a bit more step by step...Please help... Sorry Bryton, I

Re: [Tutor] Python Variables Changing in Other Functions

2011-05-27 Thread Steven D'Aprano
Rachel-Mikel ArceJaeger wrote: Hello, I am having trouble with determining when python is passing by reference and by value Others have already discussed this, but at the risk of blowing my own trumpet, I'd like to point you at an earlier discussion on this list:

Re: [Tutor] Python Interview Questions..

2011-05-27 Thread col speed
On 27 May 2011 17:31, Walter Prins wpr...@gmail.com wrote: I find this thread very interesting. I've been learning Python on and off for the past 3 years, as a hobby. I am over 50 years old, so will never be a programmer. However: 1/ I've done a bit in Project Euler and have found many

[Tutor] Creating a dictionary

2011-05-27 Thread Válas Péter
Hi, I think I am new to here, as far as I remember. :-) http://docs.python.org/dev/library/stdtypes.html#dict says: we can create a dictionary with - dict({'one': 1, 'two': 2}) What is the adventage of this form to simply writing d = {'one': 1, 'two': 2}? Is there any difference? Thanks

Re: [Tutor] Creating a dictionary

2011-05-27 Thread spawgi
The first approach does not really give you any variable (in easy form) to operate upon. The second approach returns a dict object that you can later reuse in easier form. So one advantage is certainly that ease of object reuse and also object modification. If you want to add, remove, update

Re: [Tutor] Creating a dictionary

2011-05-27 Thread Válas Péter
Sorry, I am afraid, I was not clear enough. So what is the difference between d = dict({'one': 1, 'two': 2}) and d = {'one': 1, 'two': 2} ? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] Creating a dictionary

2011-05-27 Thread spawgi
I think the way - d = dict({'one': 1, 'two': 2}) can be used to created dictionary using list comprehension. e.g. d = dict((i,i**2) for i in range(10)) d {0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81} I do not think the second approach can be used in this fashion. From

Re: [Tutor] Creating a dictionary

2011-05-27 Thread Steven D'Aprano
Válas Péter wrote: Hi, I think I am new to here, as far as I remember. :-) http://docs.python.org/dev/library/stdtypes.html#dict says: we can create a dictionary with - dict({'one': 1, 'two': 2}) What is the adventage of this form to simply writing d = {'one': 1, 'two': 2}? Is there any

Re: [Tutor] Creating a dictionary

2011-05-27 Thread delegbede
The first instance is more keystrokes while the second saves u that. Sent from my BlackBerry wireless device from MTN -Original Message- From: Válas Péter suli...@postafiok.hu Sender: tutor-bounces+delegbede=dudupay@python.org Date: Fri, 27 May 2011 16:19:08 To: spa...@gmail.com Cc:

Re: [Tutor] Creating a dictionary

2011-05-27 Thread Válas Péter
2011. május 27. 16:31 írta, spa...@gmail.com: I think the way - d = dict({'one': 1, 'two': 2}) can be used to created dictionary using list comprehension. e.g. d = dict((i,i**2) for i in range(10)) I think this is not the same syntax, there are no braces in. dict({'one': 1, 'two': 2})

Re: [Tutor] Python Interview Questions..

2011-05-27 Thread Walter Prins
Hi Colin, On 27 May 2011 14:41, col speed ajarnco...@gmail.com wrote: I've been learning Python on and off for the past 3 years, as a hobby. I am over 50 years old, so will never be a programmer. However: Well just because you're 50 years old doesn't mean you will never be a programmer ;)

Re: [Tutor] Creating a dictionary

2011-05-27 Thread delegbede
Nice observation Spawgi. Sent from my BlackBerry wireless device from MTN -Original Message- From: spa...@gmail.com Sender: tutor-bounces+delegbede=dudupay@python.org Date: Fri, 27 May 2011 20:01:24 To: Válas Pétersuli...@postafiok.hu Cc: tutor@python.org Subject: Re: [Tutor]

Re: [Tutor] Creating a dictionary

2011-05-27 Thread Peter Otten
Válas Péter wrote: I think I am new to here, as far as I remember. :-) http://docs.python.org/dev/library/stdtypes.html#dict says: we can create a dictionary with - dict({'one': 1, 'two': 2}) What is the adventage of this form to simply writing d = {'one': 1, 'two': 2}? Is there

Re: [Tutor] Creating a dictionary

2011-05-27 Thread Válas Péter
2011/5/27 Steven D'Aprano st...@pearwood.info Never put a lone dict literal {...} inside a call to dict(), that's just a waste of time. Just use the literal on its own. That's what I thought about this, I just didn't want to believe that docs.python.org wrote a redundant example. third_dict

Re: [Tutor] Creating a dictionary

2011-05-27 Thread spawgi
Thanks for the detailed explanation Steve. That was very helpful. On Fri, May 27, 2011 at 8:04 PM, Steven D'Aprano st...@pearwood.infowrote: Válas Péter wrote: Hi, I think I am new to here, as far as I remember. :-) http://docs.python.org/dev/library/stdtypes.html#dict says: we can create

Re: [Tutor] Python Interview Questions..

2011-05-27 Thread Marc Tompkins
On Fri, May 27, 2011 at 1:59 AM, Alan Gauld alan.ga...@btinternet.comwrote: I want them to have studied the subject deeply and have a wealth of experience. Studying computing because its an easy option is not an option because its never easy. That was the point that Joel and I were making.

Re: [Tutor] Python Interview Questions..

2011-05-27 Thread Brett Ritter
On Fri, May 27, 2011 at 12:51 PM, Marc Tompkins marc.tompk...@gmail.com wrote: That was the point that Joel and I were making.  The CS programs that have become Java schools now make the curriculum as easy as possible because they The concept that knowledge/ability to use a language doesn't

Re: [Tutor] Could I modify codes and validate immediately withoutrestart program?

2011-05-27 Thread Prasad, Ramit
Does python has the ability to set cc to 34 after file savings without restarting whole program? No, and I don;t know of any language than can unless you explicitly reload the code. But that is usually a feature of the debugger/interpreter rather than the language. It is not quite the same, but

Re: [Tutor] nested / concatenated function docstrings?

2011-05-27 Thread Prasad, Ramit
I knew I could set the docstring (and played with it) but I did not realize that would work when the function is imported from a module! Thank you, Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423

Re: [Tutor] nested / concatenated function docstrings?

2011-05-27 Thread ALAN GAULD
I knew I could set the docstring (and played with it) but I did not realize that would work when the function is imported from a module! You are changing the doc string of the function in the same module, you couldn't change the docstring of a function in another module - or at least

Re: [Tutor] Python Interview Questions..

2011-05-27 Thread Alan Gauld
Walter Prins wpr...@gmail.com wrote Java just isn't a hard enough language to separate great programmers from plodders (neither is Python, for that matter) because pointers and memory allocation are taken care of automagically. I fundamentally disagree with his stand on this. Not sure what

Re: [Tutor] Clunky Password maker

2011-05-27 Thread Alan Gauld
Steven D'Aprano st...@pearwood.info wrote whrandom was deleted in Python 2.5! Well, I'm using 2.5 but I confess I didn't try it, I looked up my O'Reilly Python standard Library book because I already had it to hand. It obviously predates 2.5! :-) Alan G.

Re: [Tutor] Could I modify codes and validateimmediately withoutrestart program?

2011-05-27 Thread Alan Gauld
Prasad, Ramit ramit.pra...@jpmchase.com wrote It is not quite the same, but there are debuggers (not sure about for Python) that will let you change the *in memory* value of cc on the fly. Yes Pythons debugger can set a variable value during a break. But the OP wanted to do it in the

Re: [Tutor] Python Interview Questions..

2011-05-27 Thread Steven D'Aprano
Marc Tompkins wrote: And anyone who starts down that road will be weeded out very quickly. Not quickly enough! They should be weeded out IN SCHOOL, or before they even commit to a computer-science track. It's cruel to students, inefficient for business, and disastrous for consumers if they

Re: [Tutor] Python Interview Questions..

2011-05-27 Thread Steven D'Aprano
Alan Gauld wrote: Walter Prins wpr...@gmail.com wrote Java just isn't a hard enough language to separate great programmers from plodders (neither is Python, for that matter) because pointers and memory allocation are taken care of automagically. I fundamentally disagree with his stand on

Re: [Tutor] Python Interview Questions..

2011-05-27 Thread Marc Tompkins
On Fri, May 27, 2011 at 8:38 PM, Steven D'Aprano st...@pearwood.infowrote: Not such a good analogy, since modern consumer goods are getting to the point where they are almost unrepairable except by replacing the control board. It often costs you *more* to fix a broken widget than to throw the