~doctormo/python-snippets/lp-merge-request-example

1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python
#
# [SNIPPET_NAME: Reversing strings]
# [SNIPPET_CATEGORIES: Python Core]
# [SNIPPET_DESCRIPTION: How to reverse the contents of a string]
# [SNIPPET_AUTHOR: Scott Ferguson <scottwferg@gmail.com>]
# [SNIPPET_LICENSE: GPL]

text = ['Hello', 'world', 'Go hang a salami I\'m a lasagna hog']

for word in text:
    print word[::-1]