Re: [Tutor] Python 2.3.5 question

2009-09-23 Thread rspl...@earthlink.net
Hello. I am Roman. I bought this book call Python Programming for the Absolute Beginner which I am and after I downloaded Python 2.3.5 from their CD, I opened IDLE, typed "Game Over" and nothing happened. What do I do? Please, help. I don't understand any of the programming jargon. Please talk s

Re: [Tutor] What is this an example of (and how can i use it?)

2009-09-23 Thread Kent Johnson
On Wed, Sep 23, 2009 at 12:58 AM, kevin parks wrote: > It appears it is not so impenetrable as i initially > though. Well iterators > aren't maybe, but generator do look tricky. So interators iterate over > lists, tuples, strings, dictionaries > and any data type that is iterable, and generators

Re: [Tutor] Python 2.3.5 question

2009-09-23 Thread Tim Bowden
On Wed, 2009-09-23 at 01:10 -0700, rspl...@earthlink.net wrote: > Hello. I am Roman. I bought this book call Python Programming for the > Absolute Beginner which I am and after I downloaded Python 2.3.5 from > their CD, I opened IDLE, typed "Game Over" and nothing happened. What > do I do? Please,

[Tutor] how to print a message backwards

2009-09-23 Thread Ali Sina
#Message backward printer message=input('Enter your message: ') for i in range(len(message),0,-1):     print(message) This is the code which I have written. All it does is count the number of letters starting from backwards. The proper code should so something like this: Enter your message: Hi

Re: [Tutor] how to print a message backwards

2009-09-23 Thread Serdar Tumgoren
Try reading up on sequences and slicing. They offer a very elegant solution to your (homework?) problem. http://docs.python.org/tutorial/introduction.html#strings ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

Re: [Tutor] how to print a message backwards

2009-09-23 Thread Serdar Tumgoren
> http://docs.python.org/tutorial/introduction.html#strings > The below page is a better introduction to sequences: http://effbot.org/zone/python-list.htm It uses lists, but the lessons on slicing also apply to strings (which are a type of sequence). HTH! Serdar

Re: [Tutor] Python 2.3.5 question

2009-09-23 Thread Alan Gauld
Hello. I am Roman. Hi Roman. I bought this book call Python Programming for the Absolute Beginner which I am and after I downloaded Python 2.3.5 from their CD, I opened IDLE, typed "Game Over" and nothing happened. Why did you do that? Did the book say to do it? Are you sure that's what it s

Re: [Tutor] how to print a message backwards

2009-09-23 Thread Alan Gauld
"Ali Sina" wrote #Message backward printer message=input('Enter your message: ') for i in range(len(message),0,-1): print(message) This is the code which I have written. All it does is count the number of letters starting from backwards. Correct, plus it prints the original message eac

Re: [Tutor] Python 2.3.5 question

2009-09-23 Thread C or L Smith
>> Hello. I am Roman. I bought this book call Python Programming for >> the Absolute Beginner which I am and after I downloaded Python 2.3.5 >> from their CD, I opened IDLE, typed "Game Over" and nothing >> happened. What do I do? Please, help. I don't understand any of the >> programming jargon. P

Re: [Tutor] how to print a message backwards

2009-09-23 Thread Robert Berman
Is there a significant difference in speed, style, or any pythonesque reasoning between Alan's solution and print message[::-1] Thanks for any information, Robert On Wed, 2009-09-23 at 18:51 +0100, Alan Gauld wrote: > "Ali Sina" wrote > > #Message backward printer > message=input('Enter you

Re: [Tutor] ODBC SQL Server Question

2009-09-23 Thread Kristina Ambert
Hi, Thanks you guys for the replies and thanks Kent for the explanation, and yes, this: self.cursor.execute("SELECT CUSTID FROM Stories WHERE NAME= ?", (name, )) using the comma did make it work. On Fri, Sep 18, 2009 at 3:40 PM, Jeff Johnson wrote: > Thanks for the clarification Kent! > > > Ke

[Tutor] Switching from 2.3 to 2.6

2009-09-23 Thread Kristina Ambert
Hi guys, I'm getting this error after I tried to switch from python 2.3 to 2.6. I tried to look online for what it means, but I can't find any good explanation. Do any of you guys have any idea what's causing it and what it means? C:\Python26\lib\site-packages\win32\lib\dbi.py:13: DeprecationWarnin

Re: [Tutor] how to print a message backwards

2009-09-23 Thread Emile van Sebille
On 9/23/2009 7:22 AM Ali Sina said... #Message backward printer message=input('Enter your message: ') for i in range(len(message),0,-1): print(message) This is the code which I have written. All it does is count the number of letters starting from backwards. The proper code should so some

Re: [Tutor] Switching from 2.3 to 2.6

2009-09-23 Thread Benno Lang
On Thu, Sep 24, 2009 at 5:46 AM, Kristina Ambert wrote: > Hi guys, > I'm getting this error after I tried to switch from python 2.3 to 2.6. I > tried to look online for what it means, but I can't find any good > explanation. > Do any of you guys have any idea what's causing it and what it means? >

Re: [Tutor] how to print a message backwards

2009-09-23 Thread ALAN GAULD
> Is there a significant difference in speed, style, or any pythonesque > reasoning between Alan's solution and > print message[::-1] Yes, the for loop doing one character at a time will be much slower than using a slice. The slice is more pythonic but less general. A reverse loop is something

Re: [Tutor] how to print a message backwards

2009-09-23 Thread Robert Berman
Thank you for the clear explanation. Robert On Wed, 2009-09-23 at 23:40 +, ALAN GAULD wrote: > > Is there a significant difference in speed, style, or any pythonesque > > reasoning between Alan's solution and > > print message[::-1] > > > Yes, the for loop doing one character at a time