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 trialJiayang Shi
Python Web Development Techdegree Student 4,862 PointsPlease help, what's wrong with my code? "Try again" appeard in the last step constantly. Thank you very much.
What's wrong with my tag used in last page?
from django import template
register = template.Library()
@register.simple_tag
def conjugate_is(num):
if num == 1:
return 'is'
else:
return 'are'
{% load fairy_extras %}
There {% conjugate_is(num_elf) %} {{ num_elf }} el{{ num_elf|pluralize:"f,ves" }}.
1 Answer
Bogdan Lalu
6,419 PointsYou mustn't pass the argument like in an ordinary function, tags work differently. Try {% conjugate_is num_elf %} instead of {% conjugate_is(num_elf) %}
Cheo R
37,150 PointsCheo R
37,150 PointsI copied and pasted your code into the challenge and it worked just fine (for both challenges). So it might that you have extra spaces/blank lines somewhere?