View Single Post
Old 01-31-2013, 08:01 PM   #11827
Geoc
RS.net, where our google ads make absolutely no sense!
 
Join Date: Mar 2011
Location: Richmond
Posts: 915
Thanked 693 Times in 227 Posts
Failed 68 Times in 25 Posts
Assuming find can recognize " " correctly:

name = raw_input
first_name_letter = name[0]
last_name_first_letter=name[name.find(" ") + 1]
last_name_last_letter=name[len(name)-1]

this is using no loops and assumes str.find() can recognize whitespace
Geoc is offline   Reply With Quote
This post thanked by: