Smart Tech

Showing posts with label word. Show all posts
Showing posts with label word. Show all posts

Wednesday, June 10, 2015

Reverse each word in a sentence - Python

# your code goes here

st = "This is awesome!"

st1 = st.split(" ")
st2 = ''
st3 = []

print st1

for y in st1:
#print y
ls = len(y)
for x in range(len(y)):
st2 = st2 + y[ls - 1 -x]
st2 = st2 + ' '
st3.append(st2)
print ' '.join(st3)
Posted by Sree Sindhu Sruthi at 8:51 PM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: Python, Reverse each word, Strings, word
Older Posts Home
Subscribe to: Posts (Atom)

Blog Archive

  • ▼  2021 (6)
    • ▼  September (1)
      • Write your own Static analyzer in golang
    • ►  August (1)
    • ►  July (4)
  • ►  2020 (1)
    • ►  May (1)
  • ►  2019 (2)
    • ►  March (2)
  • ►  2018 (1)
    • ►  February (1)
  • ►  2017 (3)
    • ►  May (2)
    • ►  January (1)
  • ►  2016 (19)
    • ►  November (4)
    • ►  October (1)
    • ►  September (3)
    • ►  August (2)
    • ►  June (1)
    • ►  March (2)
    • ►  February (4)
    • ►  January (2)
  • ►  2015 (19)
    • ►  November (2)
    • ►  June (12)
    • ►  May (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (2)
  • ►  2014 (2)
    • ►  October (2)
  • ►  2013 (4)
    • ►  August (1)
    • ►  April (1)
    • ►  March (2)

About Me

Sree Sindhu Sruthi
View my complete profile
Simple theme. Theme images by luoman. Powered by Blogger.