Advertisement
12311k

Untitled

May 2nd, 2020
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. from django import template
  2.  
  3. register = template.Library()
  4.  
  5. @register.filter
  6. def uglify(value):
  7. count = 0
  8. result = ''
  9. for char in value:
  10. count += 1
  11. if count % 2 == 0:
  12. result += char.upper()
  13. else:
  14. result += char.lower()
  15. return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement