Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Customizing Django Templates Building Custom Filters Reverse Text Filter

SyntaxError: def reverse_text("balloon"):

I'm not understanding this I've looked at past answers and still not understanding it def reverse_text("balloon"): return noollab

code_challenges/templatetags/extras.py
from django import template

register = template.Library()

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,441 Points

The reverse_text function needs to accept a string argument. This needs to be a variable name instead of a static string. The function then needs to return the reverse of this string. A quick way to reverse a string is by slicing it with [::-1].

Post back if you need more help. Good luck!!

def reverse_text(string): return string[::-1]