Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. def format(x):
  2. return x
  3. def modify(string):
  4. for x in words:
  5. if statement:
  6. return x[v:] + x[:v] + "xx"
  7. else:
  8. return x + "xx"
  9. def final(string):
  10. return format(modify(string))
  11.  
  12. >>>final("This is a test case")
  13. >>>>Htisxx
  14.  
  15. >>>final("This is a test case")
  16. >>>>Htisxx isxx axx esttxx asecxx
  17.  
  18. def first_vowel(word):
  19. for offset,ch in enumerate(word):
  20. if ch in "aeiou":
  21. return offset
  22. return 0
  23.  
  24. def modify_word(word):
  25. v = first_vowel(word)
  26. return word[v:] + word[:v] + "xx"
  27.  
  28. def modify(s):
  29. words = s.split()
  30. return ' '.join(modify_word(word) for word in words)
  31.  
  32. def format(s):
  33. return s
  34.  
  35. def final(s):
  36. return format(modify(s))
  37.  
  38. final("This is a test case") # => 'isThxx isxx axx esttxx asecxx'
  39.  
  40. def format(x):
  41. return x
  42. def modify(string):
  43. for x in words:
  44. if statement:
  45. return x[v:] + x[:v] + "xx"
  46. else:
  47. return x + "xx"
  48. def final(string):
  49. return format(modify(string))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement