[Tutor] newbie 'while' question
by Matthew Richardson other posts by this author
Jun 30 2003 5:49PM messages near this date
Re: [Tutor] newbie re question
|
Re: [Tutor] newbie 'while' question
I'm working through Josh Cogliati's tutorial and Wesley Chun's book to
learn Python. So far things have been going smoothly, easy to say since
I've only hit the third chapter. However, I'm stuck on an easy problem
and it's causing me grief because I know it should be easy. The
exercise is to take a string that is inputted by the user and print each
letter of the string individually, solve with a 'for' and a 'while.'
The 'for' was easy:
s = raw_input('Enter a name: ')
for x in s:
print x
Trying to do it with 'while', I've only managed to get it to print
through to the last character, where it loops and continues to print the
last character until escaped. Someone willing to point me in the right
direction?
Thanks,
Matt
--
Matt Richardson
Instructional Support Technician
Department of Art
CSU San Bernardino
_______________________________________________
Tutor maillist - Tutor@[...].org
http://mail.python.org/mailman/listinfo/tutor
Thread:
Matthew Richardson
Danny Yoo
Matthew Richardson
Kalle Svensson
Eric L Howard
Danny Yoo
Matthew Richardson
Matthew Richardson
Matthew Richardson
Danny Yoo
Matthew Richardson
Danny Yoo
Zak Arntson
Zak Arntson
Zak Arntson
Zak Arntson
|