> Is there a significant difference in speed, style, or any pythonesque > reasoning between Alan's solution and > print message[::-1]
Yes, the for loop doing one character at a time will be much slower than using a slice. The slice is more pythonic but less general. A reverse loop is something that is often needed in programming solutions so it's useful to know how to do it for the general case. But where the data can be sliced that will be faster and more concise. Alan G. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor