Stop Spinning My Words in python codewars

Shashivardhan
Apr 21, 2021

Write a function that takes in a string of one or more words, and returns the same string, but with all five or more letter words reversed (like the name of this kata).

1.Strings passed in will consist of only letters and spaces.
2.Spaces will be included only when more than one word is present.

spinWords(“Hey fellow warriors”) => “Hey wollef sroirraw” spinWords(“This is a test”) => “This is a test”

spinWords(“This is another test”) => “This is rehtona test”

Originally published at https://onlylang.blogspot.com.

--

--