[Jim, when you reply, please send to [EMAIL PROTECTED] Don't just send
your reply only to me. Use your email client's Reply-To-All feature.]
[Jim]
> > The following gives me the last letter of the string.
> >
> > backwords=raw_input("enter number or string:")
> > print backwords[-1]
April 14, 2005 1:52
PM
Subject: Re: [Tutor] Python backwards
program (fwd)
> Does the 2.2 python have the ability to do
this?Hi Jim,Python 2.2 is actually a bit old; you may want to
update the version ofPython on your system to Python 2.4. You can
find it here: http://www.py
> Does the 2.2 python have the ability to do this?
Hi Jim,
Python 2.2 is actually a bit old; you may want to update the version of
Python on your system to Python 2.4. You can find it here:
http://www.python.org/2.4/
A lot of the approaches you were trying earlier used features that were
-- Forwarded message --
Date: Thu, 14 Apr 2005 00:41:40 -0500
From: Jim and Laura Ahl <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Python backwards program
I thought you were on me a bit but I am so frustrated at this point. My
instruct
-- Forwarded message --
Date: Thu, 14 Apr 2005 00:41:40 -0500
From: Jim and Laura Ahl <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Python backwards program
I thought you were on me a bit but I am so frustrated at this point. My
inst
> We're not going to do your homework problems; please understand that we
> actually don't care if you get your homework done. And I really hope that
> people don't just start blurting stuff at Jim for the other three homework
> problems he's dumping on us.
Hi Jim,
Ok, I screwed up big time to
> In the print word [::-1] line it gives me this message
> (sequence index must be an integer) What does that mean
As others have said, it means you're using Python 2.2 or older (so can't use
extended slicing). It seems likely that what you're after is the loop
approach that has been mentioned b
> I have wrote 3 other programs in the class.
Hi Jim,
[cut]
Ok, that's where I have to stop you for a moment.
We're not going to do your homework problems; please understand that we
actually don't care if you get your homework done. And I really hope that
people don't just start blurting stu
> I cannot write a program that gives me a double letter.
> I can get each letter separate or pieces or parts of the word
Hi Jim,
[Please don't reply just to me: use the Reply-to-All feature on your email
program. This allows your reply to be seen by the rest of us here. I
want to make sure yo
-- Forwarded message --
Date: Wed, 13 Apr 2005 09:01:16 -0500
From: Jim and Laura Ahl <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Python backwards program (fwd)
Danny
I cannot write a program that gives me a double letter.
I can get
Jim and Laura Ahl wrote:
Thanks for the encouragement, here is what I have so far.
word=raw_input("Enter a Word or string:")
print word
print word[::-1]
raw_input("\n\nPress the enter key to exit.")
In the print word [::-1] line it gives me this message (sequence index
must be an integer) Wha
cookie program that randomly gives one fortune out of 5 to the
user.
Jim
- Original Message -
From:
Feziwe Mpondo
To: Alberto Troiano
Cc: [EMAIL PROTECTED] ; tutor@python.org
Sent: Wednesday, April 13, 2005 10:14
AM
Subject: Re: [Tutor] Python backwards
progr
in a little more specific (that's only applied to me :))
Regards
Alberto
Gaucho>From: Feziwe Mpondo <[EMAIL PROTECTED]> >To: Alberto Troiano <[EMAIL PROTECTED]> >CC: [EMAIL PROTECTED], tutor@python.org >Subject: Re: [Tutor] Python backwards program >Date: Wed, 13 Apr
t; backword=""
>>> counter=len(word)
>>> while counter!=0:
backword+=word[counter-1]
counter-=1
>>> print backword
tseroF irikoK
So choose the one you want and feel free to ask in case of any doubt
Regards
Alberto
Gaucho
>From: &qu
> counter=len(word)
>>> while counter!=0: backword+=word[counter-1] counter-=1
>>> print backwordtseroF irikoK
So choose the one you want and feel free to ask in case of any doubt
Regards
Alberto
Gaucho>From: "Jim and Laura Ahl" <[EMAIL
> We will not do your homework for you
[snip]
The slicing answer I posted is possibly the answer, but I assume that the
loop solution, which I didn't post (in Python), is what is actually
required. If slicing is what is wanted, then I apologise for giving an
answer! :)
=Tony.Meyer
_
> I have read about loops, strings, tuples. I am taking this
> class on distance education and I am lost with this
> assignment. I have read what Tony has wrote and that does me
> no good. I do not understand what he is talking about.
Which bits? The whole lot? I teach university students
: Jim and Laura Ahl <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Python backwards program
I have read about loops, strings, tuples. I am taking this class on
distance education and I am lost with this assignment. I have read
what Tony has wrote and tha
Hello Jim,
> I have read about loops, strings, tuples.
Can you show us an example of a loop? Can you show us the last program
that you've written?
It sounds like you've done a lot of reading. The problem with learning
how to program is that you can't just read it: you actually have to write
-- Forwarded message --
Date: Tue, 12 Apr 2005 22:37:44 -0500
From: Jim and Laura Ahl <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Python backwards program
I have read about loops, strings, tuples. I am taking this class on distance
e
On Wed, 13 Apr 2005, Tony Meyer wrote:
> > I am very new to programming and I have an assignment to have a
> > raw_input string that is inputted by the user and then is printed
> > backwards. Can anyone help me? I can get it to print regular but
> > backwards in not working.
>
> I guess that I
> I am very new to programming and I have an assignment
> to have a raw_input string that is inputted by the user
> and then is printed backwards. Can anyone help me? I can
> get it to print regular but backwards in not working.
I guess that I shouldn't give code if this is for an assignment, bu
I am very new to programming and I have an assignment to have a raw_input
string that is inputted by the user and then is printed backwards.
Can anyone help me? I can get it to print regular but backwards in not
working.
Thank You
Jim
___
Tutor
23 matches
Mail list logo