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 trialRabih Atallah
3,405 PointsWhat is missing in my code?
The question is to create a Challenge with the function's parameter as the attributes
from models import Challenge
def create_challenge(name, language, steps = 1):
Challenge.create(name = 'rabih', language = 'english', steps = 1)
1 Answer
Dan Johnson
40,533 PointsThe arguments being passed into create should be assigned the values that were passed in to the create_challenge function.
Rabih Atallah
3,405 PointsRabih Atallah
3,405 Pointsand now it's still not working: from models import Challenge def create_challenge(name, language, steps = 1): Challenge.create(name = "Ruby", language = "Booleans", steps) pass
Dan Johnson
40,533 PointsDan Johnson
40,533 PointsThat's still hard wiring in literals. It looks strange, but you can do stuff like
name = name
when dealing with the inner call to the create method.