ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-Tutor
python-Tutor
[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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved