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 trialChristopher Gomez
Courses Plus Student 13,800 PointsUpdate the conjugate_is function to return the string 'are' if the number is anything other than 1.
Having trouble with this kinda remember how to do it but I think I'm doing something wrong
from django import template
register = template.Library()
def conjugate_is(int):
if int == 1:
return 'is'
else int == 1:
return 'are'
{% load fairy_extras %}
There is {{ num_elf }} el{{ num_elf|pluralize:"f,ves" }}.
2 Answers
Carson Alexander
Python Web Development Techdegree Graduate 12,172 PointsUpdated code will look like:
from django import template
register = template.Library()
def conjugate_is(int):
if int == 1:
return 'is'
else:
return 'are'
Christopher Gomez
Courses Plus Student 13,800 Points@Cody Lovell Thanks for the help I would mark best answer but it's not giving me the option
Cody Lovell
Python Web Development Techdegree Student 7,223 PointsCody Lovell
Python Web Development Techdegree Student 7,223 PointsI know this is a late answer, but just in case: you just need to get rid of the second check for "int == 1" in the else clause. Because they want are returned if int is anything other than 1.