noob question Letters in words?

Paul Rubin http
Fri Oct 7 22:13:27 EDT 2005


"Ivan Shevanski" <darkpaladin79 at hotmail.com> writes:
> choice1 = raw_input("> ")

choice1 is now the whole string that the user types

> Is there a way (I searched for a module but didnt find one) that I can
> do something like this?
> 
> if choice1 in ('1', 'S', 's'):
>     #do first option

You'd use choice1[0] to get the first letter of choice1.



More information about the Python-list mailing list