(str1, str2, str3, rest) = str.split(" ", 3)
Later that I realize that str could contain values of less than 4 strings, in which case it would complain something like -- ValueError: unpack list of wrong size.
Now I don't want to spoil the fun.
In essence, I'd like to capture the first 3 words in a string. If str is less than 3 words then any or all of the containers could have a None value.
TIA.
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor